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>
This commit is contained in:
Marcos CARDINOT 2015-03-19 16:32:31 -03:00 committed by Dirk Hohndel
parent 4571aa7ac6
commit ff860b3c04

View file

@ -718,6 +718,8 @@ static bool process_raw_buffer(device_data_t *devdata, uint32_t deviceid, char *
/* is it a valid entry or nothing ? */ /* is it a valid entry or nothing ? */
if (strcmp(tp, "1.0") != 0 || strstr(inbuf, "divelog{1.0{{{{")) { if (strcmp(tp, "1.0") != 0 || strstr(inbuf, "divelog{1.0{{{{")) {
free(buf); free(buf);
free(tp);
free(bp);
return false; return false;
} }
} else if (strcmp(tp, "dive") == 0) { } 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); tp = next_token(&bp);
if (strcmp(tp, "1.0") != 0) { if (strcmp(tp, "1.0") != 0) {
free(buf); free(buf);
free(tp);
free(bp);
return false; return false;
} }
} else { } else {
/* don't understand the buffer */ /* don't understand the buffer */
free(buf); free(buf);
free(bp);
free(tp);
return false; return false;
} }
if (log) { 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"); fprintf(debugfile, "p_r_b entry deleted\n");
#endif #endif
/* oops, this one isn't valid, suggest to try the previous one */ /* oops, this one isn't valid, suggest to try the previous one */
free(buf);
free(bp);
free(tp);
return false; return false;
} }
} }