diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2012-12-24 03:53:27 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2012-12-27 08:15:11 -0800 |
commit | 310b05ac84961ca15643d92b41ee14d392e133d8 (patch) | |
tree | ecdc267c940a0c838c3f23746c9da48ec9299177 /dive.c | |
parent | 906fd400e774e3db5ecdfd4956406d8396387942 (diff) | |
download | subsurface-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.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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); } |