summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/liquivision.c4
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)