summaryrefslogtreecommitdiffstats
path: root/core/file.c
diff options
context:
space:
mode:
authorGravatar Berthold Stoeger <bstoeger@mail.tuwien.ac.at>2018-08-18 13:45:13 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-08-23 05:07:58 -0700
commitb6187f73aad09adb0b70af8d77f1af1a34a338f8 (patch)
tree7464fc6ee447c7aba83222e3c4970a885dadff56 /core/file.c
parent7ae1b8cb11e0a4ede3dab6cd30c99009142b5215 (diff)
downloadsubsurface-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.c8
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 */