summaryrefslogtreecommitdiffstats
path: root/uemis-downloader.c
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2013-12-11 00:53:29 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-11 03:13:30 +0100
commitef3a51f6eeb6346e2b234af5a091e42238c46c62 (patch)
tree047889b2ad6fdb0daebd8bcec859768629387146 /uemis-downloader.c
parentd0c7b3bf7dd4c5514a1c73c64b3a5ab9f219e34d (diff)
downloadsubsurface-ef3a51f6eeb6346e2b234af5a091e42238c46c62.tar.gz
Plug potential memory leak in process_raw_buffer
Free temporary buffer before returning. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'uemis-downloader.c')
-rw-r--r--uemis-downloader.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/uemis-downloader.c b/uemis-downloader.c
index e8e24b78e..b1d977d41 100644
--- a/uemis-downloader.c
+++ b/uemis-downloader.c
@@ -644,15 +644,20 @@ static void process_raw_buffer(uint32_t deviceid, char *inbuf, char **max_divenr
/* this is a divelog */
log = TRUE;
tp = next_token(&bp);
- if (strcmp(tp,"1.0") != 0)
+ if (strcmp(tp,"1.0") != 0) {
+ free(buf);
return;
+ }
} else if (strcmp(tp, "dive") == 0) {
/* this is dive detail */
tp = next_token(&bp);
- if (strcmp(tp,"1.0") != 0)
+ if (strcmp(tp,"1.0") != 0) {
+ free(buf);
return;
+ }
} else {
/* don't understand the buffer */
+ free(buf);
return;
}
if (log)