gobject-introspection r899 - in trunk: . girepository



Author: tko
Date: Wed Nov 12 14:42:13 2008
New Revision: 899
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=899&view=rev

Log:
Fix minor memory leak.

2008-11-12  Tommi Komulainen  <tommi komulainen iki fi>

	* girepository/girepository.c (find_namespace_latest): Fix
	minor memory leak.

Modified:
   trunk/ChangeLog
   trunk/girepository/girepository.c

Modified: trunk/girepository/girepository.c
==============================================================================
--- trunk/girepository/girepository.c	(original)
+++ trunk/girepository/girepository.c	Wed Nov 12 14:42:13 2008
@@ -1015,12 +1015,13 @@
       candidates = g_slist_sort (candidates, (GCompareFunc) compare_candidate_reverse);
       
       elected = (struct NamespaceVersionCandidadate *) candidates->data;
-      /* Remove the elected one so we don't try to free it */
+      /* Remove the elected one so we don't try to free its contents */
       candidates = g_slist_delete_link (candidates, candidates);
       
       result = elected->mfile;
       *path_ret = elected->path;
       *version_ret = elected->version;
+      g_free (elected); /* just free the container */
       g_slist_foreach (candidates, (GFunc) free_candidate, NULL);
       g_slist_free (candidates);
     }  



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]