summaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
authorGravatar Anton Lundin <glance@acc.umu.se>2014-12-18 08:47:54 +0100
committerGravatar Dirk Hohndel <dirk@hohndel.org>2014-12-18 08:34:00 -0800
commit0bdd8f41e0b217c6f0a3723dd756e96c93b3f5c6 (patch)
treeed8fb3ec0f8a20a7478d691735419c2afbd8dd93 /dive.c
parentf14ef84c9a944e407396d6985dc3b8623f3a613b (diff)
downloadsubsurface-0bdd8f41e0b217c6f0a3723dd756e96c93b3f5c6.tar.gz
Free tag lists propperly
The previous taglist_free didn't free the divetag, it only freed the tag. Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/dive.c b/dive.c
index 19d49bb37..c3f562bac 100644
--- a/dive.c
+++ b/dive.c
@@ -2461,6 +2461,12 @@ static inline void taglist_free_divetag(struct divetag *tag)
free(tag);
}
+static inline void tag_entry_free(struct tag_entry *tag_entry)
+{
+ taglist_free_divetag(tag_entry->tag);
+ free(tag_entry);
+}
+
/* Add a tag to the tag_list, keep the list sorted */
static struct divetag *taglist_add_divetag(struct tag_entry **tag_list, struct divetag *tag)
{
@@ -2529,7 +2535,7 @@ struct divetag *taglist_add_tag(struct tag_entry **tag_list, const char *tag)
void taglist_free(struct tag_entry *entry)
{
- STRUCTURED_LIST_FREE(struct tag_entry, entry, free)
+ STRUCTURED_LIST_FREE(struct tag_entry, entry, tag_entry_free)
}
/* Merge src1 and src2, write to *dst */