[gssdp] Fix crash in new refresh cache implementation



commit b5efc3c591512e5045cfa71fdf8e712edd02f138
Author: Jussi Kukkonen <jussi kukkonen intel com>
Date:   Fri Feb 22 10:35:31 2013 +0200

    Fix crash in new refresh cache implementation
    
    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 |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
---
diff --git a/libgssdp/gssdp-resource-browser.c b/libgssdp/gssdp-resource-browser.c
index 04b23fe..b0cf76c 100644
--- a/libgssdp/gssdp-resource-browser.c
+++ b/libgssdp/gssdp-resource-browser.c
@@ -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) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]