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>
This commit is contained in:
Miika Turkia 2016-02-03 07:21:13 +02:00 committed by Dirk Hohndel
parent ce373db951
commit 520f505d20

View file

@ -114,17 +114,17 @@ static void parse_dives (int log_version, const unsigned char *buf, unsigned int
model = *(buf + ptr); model = *(buf + ptr);
switch (model) { switch (model) {
case 0: case 0:
dc->model = "Xen"; dc->model = strdup("Xen");
break; break;
case 1: case 1:
case 2: case 2:
dc->model = "Xeo"; dc->model = strdup("Xeo");
break; break;
case 4: case 4:
dc->model = "Lynx"; dc->model = strdup("Lynx");
break; break;
default: default:
dc->model = "Liquivision"; dc->model = strdup("Liquivision");
break; break;
} }
ptr++; ptr++;