summaryrefslogtreecommitdiffstats
path: root/divesite.c
diff options
context:
space:
mode:
Diffstat (limited to 'divesite.c')
-rw-r--r--divesite.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/divesite.c b/divesite.c
index 5c96bb2dd..998fe23bf 100644
--- a/divesite.c
+++ b/divesite.c
@@ -170,9 +170,7 @@ void copy_dive_site(struct dive_site *orig, struct dive_site *copy)
copy->description = copy_string(orig->description);
copy->uuid = orig->uuid;
if (orig->taxonomy.category == NULL) {
- free_taxonomy(copy->taxonomy.category);
- copy->taxonomy.category = NULL;
- copy->taxonomy.nr = 0;
+ free_taxonomy(&copy->taxonomy);
} else {
if (copy->taxonomy.category == NULL)
copy->taxonomy.category = alloc_taxonomy();
@@ -200,6 +198,5 @@ void clear_dive_site(struct dive_site *ds)
ds->longitude.udeg = 0;
ds->uuid = 0;
ds->taxonomy.nr = 0;
- free_taxonomy(ds->taxonomy.category);
- ds->taxonomy.category = NULL;
+ free_taxonomy(&ds->taxonomy);
}