[gjs] gi: fix free of dangling pointer



commit 3fc0b4de2f7edbb5d4d48d95036b0d6f720a9c6b
Author: Ray Strode <rstrode redhat com>
Date:   Mon Jun 3 09:28:45 2013 -0400

    gi: fix free of dangling pointer
    
    object_instance_props_to_g_parameters is sometimes calling g_free
    on the name variable when name isn't set.
    
    This commit fixes that.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=701525

 gi/object.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
---
diff --git a/gi/object.c b/gi/object.c
index 18c1339..17498e5 100644
--- a/gi/object.c
+++ b/gi/object.c
@@ -691,12 +691,11 @@ object_instance_props_to_g_parameters(JSContext   *context,
         goto free_array_and_fail;
 
     while (!JSID_IS_VOID(prop_id)) {
-        char *name;
+        char *name = NULL;
         jsval value;
         GParameter gparam = { NULL, { 0, }};
 
         if (!gjs_object_require_property(context, props, "property list", prop_id, &value)) {
-            g_free(name);
             goto free_array_and_fail;
         }
 


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