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>
This commit is contained in:
Anton Lundin 2013-12-11 00:53:29 +01:00 committed by Dirk Hohndel
parent d0c7b3bf7d
commit ef3a51f6ee

View file

@ -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)