diff options
author | Jasper St. Pierre <jstpierre@mecheye.net> | 2012-12-06 17:38:06 -0500 |
---|---|---|
committer | Jasper St. Pierre <jstpierre@mecheye.net> | 2012-12-06 17:39:09 -0500 |
commit | 736ccb6ce1de2b3a74490d3259c1bfbbdba59792 (patch) | |
tree | 10dbb128938357464ef6e16b7487763c229dffc1 | |
parent | 4ca293e006a00ce8529e17d9202faaf68f57ff6f (diff) | |
download | gtk+-736ccb6ce1de2b3a74490d3259c1bfbbdba59792.tar.gz |
gtkcssselector: Don't leak the hash table
We should probably free the memory we allocate. Sounds like a winning
strategy.
-rw-r--r-- | gtk/gtkcssselector.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gtk/gtkcssselector.c b/gtk/gtkcssselector.c index ea7fc537ac..0c70bf786c 100644 --- a/gtk/gtkcssselector.c +++ b/gtk/gtkcssselector.c @@ -1895,7 +1895,7 @@ alloc_tree (GByteArray *array, gint32 *offset) static gint32 subdivide_infos (GByteArray *array, GList *infos, gint32 parent_offset) { - GHashTable *ht = gtk_css_selectors_count_initial_init (); + GHashTable *ht; GList *l; GList *matched; GList *remaining; @@ -1912,6 +1912,8 @@ subdivide_infos (GByteArray *array, GList *infos, gint32 parent_offset) if (infos == NULL) return GTK_CSS_SELECTOR_TREE_EMPTY_OFFSET; + ht = gtk_css_selectors_count_initial_init (); + for (l = infos; l != NULL; l = l->next) { info = l->data; @@ -1989,6 +1991,7 @@ subdivide_infos (GByteArray *array, GList *infos, gint32 parent_offset) g_list_free (matched); g_list_free (remaining); + g_hash_table_free (ht); return tree_offset; } |