summaryrefslogtreecommitdiffstats
path: root/subsurface-core/liquivision.c
diff options
context:
space:
mode:
authorGravatar Miika Turkia <miika.turkia@gmail.com>2016-02-03 07:21:13 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2016-02-03 06:06:23 -0800
commit520f505d20766fb8416de5f1e30a534abb89adba (patch)
tree29aec7fdbab984b36f82e26303c184d0c6c29872 /subsurface-core/liquivision.c
parentce373db95143fa0f05f5b12a764b14564c897540 (diff)
downloadsubsurface-520f505d20766fb8416de5f1e30a534abb89adba.tar.gz
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 <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'subsurface-core/liquivision.c')
-rw-r--r--subsurface-core/liquivision.c8
1 files 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++;