summaryrefslogtreecommitdiffstats
path: root/core/dive.c
diff options
context:
space:
mode:
Diffstat (limited to 'core/dive.c')
-rw-r--r--core/dive.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/core/dive.c b/core/dive.c
index bbfc5322d..3b3ad762d 100644
--- a/core/dive.c
+++ b/core/dive.c
@@ -754,6 +754,16 @@ void alloc_samples(struct divecomputer *dc, int num)
}
}
+void free_samples(struct divecomputer *dc)
+{
+ if (dc) {
+ free(dc->sample);
+ dc->sample = 0;
+ dc->samples = 0;
+ dc->alloc_samples = 0;
+ }
+}
+
struct sample *prepare_sample(struct divecomputer *dc)
{
if (dc) {