summaryrefslogtreecommitdiffstats
path: root/core/planner.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/planner.c')
-rw-r--r--core/planner.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/core/planner.c b/core/planner.c
index 2b58a2440..cb013799d 100644
--- a/core/planner.c
+++ b/core/planner.c
@@ -284,10 +284,7 @@ static void create_dive_from_plan(struct diveplan *diveplan, struct dive *dive,
dc->when = dive->when = diveplan->when;
dc->surface_pressure.mbar = diveplan->surface_pressure;
dc->salinity = diveplan->salinity;
- free(dc->sample);
- dc->sample = NULL;
- dc->samples = 0;
- dc->alloc_samples = 0;
+ free_samples(dc);
while ((ev = dc->events)) {
dc->events = dc->events->next;
free(ev);