Cleanup: fix memory leak on failed DLF import

In the case of a failed dlf import, the memory of the read-in
file was not freed.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-08-18 13:45:13 +02:00 committed by Dirk Hohndel
parent 7ae1b8cb11
commit b6187f73aa

View file

@ -335,11 +335,9 @@ int parse_file(const char *filename)
/* Divesoft Freedom */
if (fmt && (!strcasecmp(fmt + 1, "DLF"))) {
if (!parse_dlf_buffer(mem.buffer, mem.size)) {
ret = parse_dlf_buffer(mem.buffer, mem.size);
free(mem.buffer);
return 0;
}
return -1;
return ret;
}
/* DataTrak/Wlog */