summaryrefslogtreecommitdiffstats
path: root/divelist.c
diff options
context:
space:
mode:
Diffstat (limited to 'divelist.c')
-rw-r--r--divelist.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/divelist.c b/divelist.c
index 08246738f..bd610ac0a 100644
--- a/divelist.c
+++ b/divelist.c
@@ -1947,7 +1947,18 @@ void delete_single_dive(int idx)
dive_table.nr--;
if (dive->selected)
amount_selected--;
+ /* free all allocations */
free(dive->dc.sample);
+ if (dive->location)
+ free((void *)dive->location);
+ if (dive->notes)
+ free((void *)dive->notes);
+ if (dive->divemaster)
+ free((void *)dive->divemaster);
+ if (dive->buddy)
+ free((void *)dive->buddy);
+ if (dive->suit)
+ free((void *)dive->suit);
free(dive);
}