Fix minor memory leak.

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

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

svn path=/trunk/; revision=899
This commit is contained in:
Tommi Komulainen 2008-11-12 14:42:13 +00:00 committed by Tommi Komulainen
parent afe696cafd
commit 092901f3ab

View File

@ -1015,12 +1015,13 @@ find_namespace_latest (const gchar *namespace,
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);
}