summaryrefslogtreecommitdiffstats
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-26 09:24:56 +0100
commit7e1ba8e9255891f2992dbef0501d40aa8d8b8191 (patch)
tree5af027fc4e77e23eba373af66a795cbb564952da
parente15ec99dfe587dd39023fcb04e74220a1f23894e (diff)
downloadsubsurface-7e1ba8e9255891f2992dbef0501d40aa8d8b8191.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>
-rw-r--r--liquivision.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/liquivision.c b/liquivision.c
index 295287c15..b9db4a8f1 100644
--- a/liquivision.c
+++ b/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++;