mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 21:03:23 +00:00
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:
parent
d0c7b3bf7d
commit
ef3a51f6ee
1 changed files with 7 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Reference in a new issue