From 4baf104f0a369348185a2e2c9fdebc1423ec7f8e Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Fri, 14 May 2010 20:52:15 -0400 Subject: [PATCH] GDBus: Fix a double free Fix an unintentional double free introduced in commit 4ad4c306c3b80620185cf975b402e17a6174aea9. This bug manifested itself when trying to complete this $ gdbus introspect --system --dest --- gio/gdbus-tool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gio/gdbus-tool.c b/gio/gdbus-tool.c index 73b028f53..ec4b36cc7 100644 --- a/gio/gdbus-tool.c +++ b/gio/gdbus-tool.c @@ -308,7 +308,7 @@ print_names (GDBusConnection *c, } g_variant_get (result, "(as)", &iter); while (g_variant_iter_loop (iter, "s", &str)) - g_hash_table_insert (name_set, str, NULL); + g_hash_table_insert (name_set, g_strdup (str), NULL); g_variant_iter_free (iter); g_variant_unref (result); @@ -337,7 +337,7 @@ print_names (GDBusConnection *c, } g_variant_get (result, "(as)", &iter); while (g_variant_iter_loop (iter, "s", &str)) - g_hash_table_insert (name_set, str, NULL); + g_hash_table_insert (name_set, g_strdup (str), NULL); g_variant_iter_free (iter); g_variant_unref (result);