summaryrefslogtreecommitdiffstats
path: root/planner.c
diff options
context:
space:
mode:
Diffstat (limited to 'planner.c')
-rw-r--r--planner.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/planner.c b/planner.c
index ea180fb0a..f986af48b 100644
--- a/planner.c
+++ b/planner.c
@@ -348,13 +348,17 @@ gas_error_exit:
return;
}
-void free_dps(struct divedatapoint *dp)
+void free_dps(struct diveplan *diveplan)
{
+ if (!diveplan)
+ return;
+ struct divedatapoint *dp = diveplan->dp;
while (dp) {
struct divedatapoint *ndp = dp->next;
free(dp);
dp = ndp;
}
+ diveplan->dp = NULL;
}
struct divedatapoint *create_dp(int time_incr, int depth, struct gasmix gasmix, int po2)