diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2012-08-01 22:19:44 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2012-08-14 14:51:35 -0700 |
commit | 307240d6f6fefa83618e8c271203bc57df1081c7 (patch) | |
tree | 305c2844db6b3f6b3964cc9ec1487700f3b83533 | |
parent | 3c542b5a418751f22511f6b1d554252c6e472a43 (diff) | |
download | subsurface-307240d6f6fefa83618e8c271203bc57df1081c7.tar.gz |
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>
-rw-r--r-- | divelist.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/divelist.c b/divelist.c index 1d31da567..e994b3252 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, |