summaryrefslogtreecommitdiffstats
path: root/parse-xml.c
diff options
context:
space:
mode:
Diffstat (limited to 'parse-xml.c')
-rw-r--r--parse-xml.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/parse-xml.c b/parse-xml.c
index be5215509..9b223980d 100644
--- a/parse-xml.c
+++ b/parse-xml.c
@@ -1562,7 +1562,11 @@ static void dive_site_end(void)
if (!cur_dive_site)
return;
if (cur_dive_site->uuid) {
- struct dive_site *ds = alloc_dive_site(0);
+ // we intentionally call this with '0' to ensure we get
+ // a new structure and then copy things into that new
+ // structure a few lines below (which sets the correct
+ // uuid)
+ struct dive_site *ds = alloc_or_get_dive_site(0);
if (cur_dive_site->taxonomy.nr == 0) {
free(cur_dive_site->taxonomy.category);
cur_dive_site->taxonomy.category = NULL;