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>
This commit is contained in:
Lubomir I. Ivanov 2012-12-24 03:53:27 +02:00 committed by Dirk Hohndel
parent 906fd400e7
commit 310b05ac84

2
dive.c
View file

@ -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);
}