mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 14:25:27 +00:00
Cleanup: avoid memory leak
Coverity CID 208327 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
42db44510d
commit
1a46f5eb9b
1 changed files with 4 additions and 0 deletions
|
@ -427,6 +427,7 @@ static void parse_dives (int log_version, const unsigned char *buf, unsigned int
|
||||||
// End dive
|
// End dive
|
||||||
dive->downloaded = true;
|
dive->downloaded = true;
|
||||||
record_dive(dive);
|
record_dive(dive);
|
||||||
|
dive = NULL;
|
||||||
mark_divelist_changed(true);
|
mark_divelist_changed(true);
|
||||||
|
|
||||||
// Advance ptr for next dive
|
// Advance ptr for next dive
|
||||||
|
@ -434,6 +435,9 @@ static void parse_dives (int log_version, const unsigned char *buf, unsigned int
|
||||||
} // while
|
} // while
|
||||||
|
|
||||||
//DEBUG save_dives("/tmp/test.xml");
|
//DEBUG save_dives("/tmp/test.xml");
|
||||||
|
|
||||||
|
// if we bailed out of the loop, the dive hasn't been recorded and dive hasn't been set to NULL
|
||||||
|
free(dive);
|
||||||
}
|
}
|
||||||
|
|
||||||
int try_to_open_liquivision(const char *filename, struct memblock *mem)
|
int try_to_open_liquivision(const char *filename, struct memblock *mem)
|
||||||
|
|
Loading…
Add table
Reference in a new issue