From: Lubomir I. Ivanov Date: Wed, 1 Aug 2012 19:19:44 +0000 (+0300) Subject: Fixed a small memory leak in divelist.c X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=307240d6f6fefa83618e8c271203bc57df1081c7;p=ext%2Fsubsurface.git 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 --- 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,