mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 22:35:27 +00:00
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:
parent
7ae1b8cb11
commit
b6187f73aa
1 changed files with 3 additions and 5 deletions
|
@ -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)) {
|
||||
free(mem.buffer);
|
||||
return 0;
|
||||
}
|
||||
return -1;
|
||||
ret = parse_dlf_buffer(mem.buffer, mem.size);
|
||||
free(mem.buffer);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* DataTrak/Wlog */
|
||||
|
|
Loading…
Add table
Reference in a new issue