[glib] GDBus: Fix a double free
- From: David Zeuthen <davidz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] GDBus: Fix a double free
- Date: Sat, 15 May 2010 00:54:14 +0000 (UTC)
commit 4baf104f0a369348185a2e2c9fdebc1423ec7f8e
Author: David Zeuthen <davidz redhat com>
Date: Fri May 14 20:52:15 2010 -0400
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 <tab>
gio/gdbus-tool.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gio/gdbus-tool.c b/gio/gdbus-tool.c
index 73b028f..ec4b36c 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]