Fix crash in new refresh cache implementation
authorJussi Kukkonen <jussi.kukkonen@intel.com>
Fri, 22 Feb 2013 08:35:31 +0000 (10:35 +0200)
committerKrzesimir Nowak <krnowak@openismus.com>
Fri, 22 Feb 2013 09:26:01 +0000 (10:26 +0100)
Calling g_hash_table_insert() with same pointer as key and value is
not safe in currently released glib versions (<=2.34), see
https://bugzilla.gnome.org/show_bug.cgi?id=692815. Use
g_hash_table_add() instead.

https://bugzilla.gnome.org/show_bug.cgi?id=694418

libgssdp/gssdp-resource-browser.c

index 04b23fe..b0cf76c 100644 (file)
@@ -687,9 +687,8 @@ resource_available (GSSDPResourceBrowser *resource_browser,
         if (resource_browser->priv->fresh_resources != NULL) {
                 char *usn_copy = g_strdup (canonical_usn);
 
-                g_hash_table_insert (resource_browser->priv->fresh_resources,
-                                     usn_copy,
-                                     usn_copy);
+                g_hash_table_add (resource_browser->priv->fresh_resources,
+                                  usn_copy);
         }
 
         if (resource) {