From 3fb5f84e1196872ed33d40debd53f635a112b411 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 20 Apr 2015 21:34:15 -0700 Subject: Uemis downloader: avoid double free A well intentioned attempt in commit ff860b3c044a ("uemis-downloader - resource leaks") to fix resource leaks actually introduced a bug. Signed-off-by: Dirk Hohndel --- uemis-downloader.c | 8 -------- 1 file changed, 8 deletions(-) diff --git a/uemis-downloader.c b/uemis-downloader.c index 521cd7ef5..8f3549c97 100644 --- a/uemis-downloader.c +++ b/uemis-downloader.c @@ -718,8 +718,6 @@ 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) { @@ -727,15 +725,11 @@ 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) { @@ -749,8 +743,6 @@ static bool process_raw_buffer(device_data_t *devdata, uint32_t deviceid, char * #endif /* oops, this one isn't valid, suggest to try the previous one */ free(buf); - free(bp); - free(tp); return false; } } -- cgit v1.2.3-70-g09d2