summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Marcos CARDINOT <mcardinot@gmail.com>2015-03-19 16:32:31 -0300
committerGravatar Dirk Hohndel <dirk@hohndel.org>2015-03-19 13:46:37 -0700
commitff860b3c044a0e6b79d9e5eff0fd4efb31316edc (patch)
tree3e13bac363904bf22433441d4089e74f95f85ac3
parent4571aa7ac6b25883cd01adf35dacc56e7cb8100d (diff)
downloadsubsurface-ff860b3c044a0e6b79d9e5eff0fd4efb31316edc.tar.gz
uemis-downloader - resource leaks
Some resources are not being freed. Signed-off-by: Marcos CARDINOT <mcardinot@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--uemis-downloader.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/uemis-downloader.c b/uemis-downloader.c
index b9ea57b62..7b5a93a36 100644
--- a/uemis-downloader.c
+++ b/uemis-downloader.c
@@ -718,6 +718,8 @@ static bool process_raw_buffer(device_data_t *devdata, uint32_t deviceid, char *
/* is it a valid entry or nothing ? */
if (strcmp(tp, "1.0") != 0 || strstr(inbuf, "divelog{1.0{{{{")) {
free(buf);
+ free(tp);
+ free(bp);
return false;
}
} else if (strcmp(tp, "dive") == 0) {
@@ -725,11 +727,15 @@ static bool process_raw_buffer(device_data_t *devdata, uint32_t deviceid, char *
tp = next_token(&bp);
if (strcmp(tp, "1.0") != 0) {
free(buf);
+ free(tp);
+ free(bp);
return false;
}
} else {
/* don't understand the buffer */
free(buf);
+ free(bp);
+ free(tp);
return false;
}
if (log) {
@@ -742,6 +748,9 @@ static bool process_raw_buffer(device_data_t *devdata, uint32_t deviceid, char *
fprintf(debugfile, "p_r_b entry deleted\n");
#endif
/* oops, this one isn't valid, suggest to try the previous one */
+ free(buf);
+ free(bp);
+ free(tp);
return false;
}
}