From 307240d6f6fefa83618e8c271203bc57df1081c7 Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Wed, 1 Aug 2012 22:19:44 +0300 Subject: [PATCH] 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 --- divelist.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/divelist.c b/divelist.c index 1d31da5..e994b32 100644 --- a/divelist.c +++ b/divelist.c @@ -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, -- 2.43.0