From 520f505d20766fb8416de5f1e30a534abb89adba Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Wed, 3 Feb 2016 07:21:13 +0200 Subject: Fix Liquivision import crash When we detect a redundant DC we free the memory reserved for the model. Thus we need to malloc that memory here. Fixes #1002 Signed-off-by: Miika Turkia Signed-off-by: Dirk Hohndel --- subsurface-core/liquivision.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subsurface-core/liquivision.c b/subsurface-core/liquivision.c index 295287c15..b9db4a8f1 100644 --- a/subsurface-core/liquivision.c +++ b/subsurface-core/liquivision.c @@ -114,17 +114,17 @@ static void parse_dives (int log_version, const unsigned char *buf, unsigned int model = *(buf + ptr); switch (model) { case 0: - dc->model = "Xen"; + dc->model = strdup("Xen"); break; case 1: case 2: - dc->model = "Xeo"; + dc->model = strdup("Xeo"); break; case 4: - dc->model = "Lynx"; + dc->model = strdup("Lynx"); break; default: - dc->model = "Liquivision"; + dc->model = strdup("Liquivision"); break; } ptr++; -- cgit v1.2.3-70-g09d2