mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: use free_dive() to free dive
One would think that calling free() on a dive structure, as the code did in some places, would lead to a memory leak. (Insert rant about C memory management.) Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
252761498a
commit
1c00f9f233
5 changed files with 7 additions and 14 deletions
|
@ -821,7 +821,7 @@ static int dive_cb(const unsigned char *data, unsigned int size,
|
|||
char *date_string = get_dive_date_c_string(dive->when);
|
||||
dev_info(devdata, translate("gettextFromC", "Already downloaded dive at %s"), date_string);
|
||||
free(date_string);
|
||||
free(dive);
|
||||
free_dive(dive);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -844,7 +844,7 @@ static int dive_cb(const unsigned char *data, unsigned int size,
|
|||
|
||||
error_exit:
|
||||
dc_parser_destroy(parser);
|
||||
free(dive);
|
||||
free_dive(dive);
|
||||
return true;
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue