summaryrefslogtreecommitdiffstats
path: root/dive.c
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2012-12-24 03:53:27 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2012-12-27 08:15:11 -0800
commit310b05ac84961ca15643d92b41ee14d392e133d8 (patch)
treeecdc267c940a0c838c3f23746c9da48ec9299177 /dive.c
parent906fd400e774e3db5ecdfd4956406d8396387942 (diff)
downloadsubsurface-310b05ac84961ca15643d92b41ee14d392e133d8.tar.gz
When a dive computer is deleted also clear its model
dive.c: A dive computer may have its model allocated in memory. Let's clear that as well when calling free_dc(). Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'dive.c')
-rw-r--r--dive.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/dive.c b/dive.c
index b5fb1382e..8d1c71639 100644
--- a/dive.c
+++ b/dive.c
@@ -1251,6 +1251,8 @@ static void free_events(struct event *ev)
static void free_dc(struct divecomputer *dc)
{
free(dc->sample);
+ if (dc->model)
+ free((void *)dc->model);
free_events(dc->events);
free(dc);
}