Fix memory leak.

This commit is contained in:
Pavel Holejsovsky 2010-09-25 07:12:07 +02:00 committed by Johan Dahlin
parent 916798b704
commit 508edb91ad

View File

@ -1094,13 +1094,19 @@ enumerate_namespace_versions (const gchar *namespace,
last_dash = strrchr (entry, '-'); last_dash = strrchr (entry, '-');
version = g_strndup (last_dash+1, name_end-(last_dash+1)); version = g_strndup (last_dash+1, name_end-(last_dash+1));
if (!parse_version (version, &major, &minor)) if (!parse_version (version, &major, &minor))
{
g_free (version);
continue; continue;
} }
}
else else
continue; continue;
if (g_hash_table_lookup (found_versions, version) != NULL) if (g_hash_table_lookup (found_versions, version) != NULL)
{
g_free (version);
continue; continue;
}
g_hash_table_insert (found_versions, version, version); g_hash_table_insert (found_versions, version, version);
path = g_build_filename (dirname, entry, NULL); path = g_build_filename (dirname, entry, NULL);