summaryrefslogtreecommitdiffstats
path: root/core/datatrak.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2017-12-26 13:49:49 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-12-26 13:49:49 -0800
commitefb2640fc76dbba120c026831e0887c608ed4c66 (patch)
tree182905eb60a70c753d9866c1b631b9174d880e20 /core/datatrak.c
parent2c8614e43ed6f543f2e644661004a88414a0404e (diff)
downloadsubsurface-efb2640fc76dbba120c026831e0887c608ed4c66.tar.gz
Cleanup: avoid memory leak
The JUMP macro includes a 'goto bail', so we need to free devdata there Coverity CID 208340 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core/datatrak.c')
-rw-r--r--core/datatrak.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/datatrak.c b/core/datatrak.c
index 2f827c1bc..cb2222765 100644
--- a/core/datatrak.c
+++ b/core/datatrak.c
@@ -538,7 +538,6 @@ unsigned char *dt_dive_parser(unsigned char *runner, struct dive *dt_dive)
} else {
report_error(translate("gettextFromC", "[Error] Out of memory for dive %d. Abort parsing."), dt_dive->number);
free(compl_buffer);
- free(devdata);
goto bail;
}
if (is_nitrox)
@@ -566,6 +565,7 @@ unsigned char *dt_dive_parser(unsigned char *runner, struct dive *dt_dive)
free(devdata);
return membuf;
bail:
+ free(devdata);
return NULL;
}
/*