diff options
author | Berthold Stoeger <bstoeger@mail.tuwien.ac.at> | 2018-08-18 13:45:13 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-08-23 05:07:58 -0700 |
commit | b6187f73aad09adb0b70af8d77f1af1a34a338f8 (patch) | |
tree | 7464fc6ee447c7aba83222e3c4970a885dadff56 /core/file.c | |
parent | 7ae1b8cb11e0a4ede3dab6cd30c99009142b5215 (diff) | |
download | subsurface-b6187f73aad09adb0b70af8d77f1af1a34a338f8.tar.gz |
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>
Diffstat (limited to 'core/file.c')
-rw-r--r-- | core/file.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/core/file.c b/core/file.c index beb799c09..f350b5bc3 100644 --- a/core/file.c +++ b/core/file.c @@ -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 */ |