diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2017-12-26 14:22:52 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-12-26 14:22:52 -0800 |
commit | 1a46f5eb9bcee0f8b3fdee9fc6c4f1143b2663c0 (patch) | |
tree | a34f7e205b6d66bd583d23dac75f19cadcf7ee3e /core | |
parent | 42db44510d6e58120a9f0d272f5de2b26fb09ba7 (diff) | |
download | subsurface-1a46f5eb9bcee0f8b3fdee9fc6c4f1143b2663c0.tar.gz |
Cleanup: avoid memory leak
Coverity CID 208327
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'core')
-rw-r--r-- | core/liquivision.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/core/liquivision.c b/core/liquivision.c index f0762409c..fadde50a3 100644 --- a/core/liquivision.c +++ b/core/liquivision.c @@ -427,6 +427,7 @@ static void parse_dives (int log_version, const unsigned char *buf, unsigned int // End dive dive->downloaded = true; record_dive(dive); + dive = NULL; mark_divelist_changed(true); // Advance ptr for next dive @@ -434,6 +435,9 @@ static void parse_dives (int log_version, const unsigned char *buf, unsigned int } // while //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) |