summaryrefslogtreecommitdiffstats
path: root/core/planner.c
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2018-06-20 09:20:32 +0900
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-06-20 09:27:11 +0900
commita5380bb741c1081c86353cf5cd7b506b97e02ea9 (patch)
tree7766fa0dd4c359d07d9de95631bc052c5c082e5d /core/planner.c
parent49f3da3bfd9f336108fd5d4c3977b41e90f75d3f (diff)
downloadsubsurface-a5380bb741c1081c86353cf5cd7b506b97e02ea9.tar.gz
core: add free_samples helper
And use it in the UI and planner code. See #1411 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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);