mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Parser: free city and country after use
The variables country and city used in divinglog_place() were never freed. Free them when the pointers are reset. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
9025694d12
commit
bca9c8f88c
1 changed files with 3 additions and 1 deletions
|
@ -970,6 +970,8 @@ static void divinglog_place(char *place, uint32_t *uuid)
|
||||||
*uuid = create_dive_site(buffer, cur_dive->when);
|
*uuid = create_dive_site(buffer, cur_dive->when);
|
||||||
|
|
||||||
// TODO: capture the country / city info in the taxonomy instead
|
// TODO: capture the country / city info in the taxonomy instead
|
||||||
|
free(city);
|
||||||
|
free(country);
|
||||||
city = NULL;
|
city = NULL;
|
||||||
country = NULL;
|
country = NULL;
|
||||||
}
|
}
|
||||||
|
@ -1201,7 +1203,7 @@ static void gps_picture_location(char *buffer, struct picture *pic)
|
||||||
/* We're in the top-level dive xml. Try to convert whatever value to a dive value */
|
/* We're in the top-level dive xml. Try to convert whatever value to a dive value */
|
||||||
static void try_to_fill_dive(struct dive *dive, const char *name, char *buf)
|
static void try_to_fill_dive(struct dive *dive, const char *name, char *buf)
|
||||||
{
|
{
|
||||||
char *hash;
|
char *hash = NULL;
|
||||||
start_match("dive", name, buf);
|
start_match("dive", name, buf);
|
||||||
|
|
||||||
switch (import_source) {
|
switch (import_source) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue