[glib/g-property: 20/27] gproperty: Return a copy of the interned string when canonicalizing



commit c743bc4e0f49c505b92537f84dcd10aaf8b97583
Author: Emmanuele Bassi <ebassi linux intel com>
Date:   Thu Jul 7 12:52:05 2011 +0100

    gproperty: Return a copy of the interned string when canonicalizing
    
    The API contract says that we might modify the string, so we need to
    copy it to avoid a conditional g_free().

 gobject/gproperty.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gobject/gproperty.c b/gobject/gproperty.c
index 671a370..73072d5 100644
--- a/gobject/gproperty.c
+++ b/gobject/gproperty.c
@@ -3237,7 +3237,7 @@ g_property_canonicalize_name (const gchar *name)
   g_return_val_if_fail (name != NULL, NULL);
 
   if (is_canonical (name))
-    return g_intern_string (name);
+    return g_strdup (g_intern_string (name));
 
   retval = g_strdup (name);
   canonicalize_name (retval);



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