From 310b05ac84961ca15643d92b41ee14d392e133d8 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Mon, 24 Dec 2012 03:53:27 +0200 Subject: 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 Signed-off-by: Dirk Hohndel --- dive.c | 2 ++ 1 file changed, 2 insertions(+) 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); } -- cgit v1.2.3-70-g09d2