mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Uemis downloader: avoid double free
A well intentioned attempt in commit ff860b3c04
("uemis-downloader -
resource leaks") to fix resource leaks actually introduced a bug.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
82ff9fc9c8
commit
3fb5f84e11
1 changed files with 0 additions and 8 deletions
|
@ -718,8 +718,6 @@ 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) {
|
||||||
|
@ -727,15 +725,11 @@ 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) {
|
||||||
|
@ -749,8 +743,6 @@ static bool process_raw_buffer(device_data_t *devdata, uint32_t deviceid, char *
|
||||||
#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(buf);
|
||||||
free(bp);
|
|
||||||
free(tp);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue