summaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/dive.c b/dive.c
index b318c4be1..7ec4bc918 100644
--- a/dive.c
+++ b/dive.c
@@ -601,6 +601,7 @@ void copy_samples(struct divecomputer *s, struct divecomputer *d)
return;
int nr = s->samples;
d->samples = nr;
+ d->alloc_samples = nr;
d->sample = malloc(nr * sizeof(struct sample));
if (d->sample)
memcpy(d->sample, s->sample, nr * sizeof(struct sample));