Fixed a small memory leak in divelist.c

In fill_one_dive(), cylinder and location strings are obtained via
get_string(), which needs to allocated a litte bit of memory.

After passing the two pointers ('cylinder' and 'location') as arguments
to gtk_list_store_set() it is safe to release them.

Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
Lubomir I. Ivanov 2012-08-01 22:19:44 +03:00 committed by Dirk Hohndel
parent 3c542b5a41
commit 307240d6f6

View file

@ -556,6 +556,9 @@ static void fill_one_dive(struct dive *dive,
DIVE_OTU, dive->otu,
DIVE_TOTALWEIGHT, total_weight(dive),
-1);
free(location);
free(cylinder);
}
static gboolean set_one_dive(GtkTreeModel *model,