[gjs] value: Fix memory leak when constructing a GValue from a Boxed



commit e0a9fb98af4839700b06c8650dfd70c664f4ce05
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Mon Apr 9 22:13:07 2012 -0400

    value: Fix memory leak when constructing a GValue from a Boxed
    
    https://bugzilla.gnome.org/show_bug.cgi?id=671687

 gi/value.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/gi/value.c b/gi/value.c
index 305abf0..fe19aac 100644
--- a/gi/value.c
+++ b/gi/value.c
@@ -691,9 +691,11 @@ gjs_value_from_g_value_internal(JSContext    *context,
                       "Unexpected introspection type %d for %s",
                       g_base_info_get_type(info),
                       g_type_name(gtype));
+            g_base_info_unref(info);
             return JS_FALSE;
         }
         *value_p = OBJECT_TO_JSVAL(obj);
+        g_base_info_unref(info);
     } else if (g_type_is_a(gtype, G_TYPE_ENUM)) {
         return convert_int_to_enum(context, value_p, gtype, g_value_get_enum(gvalue));
     } else if (g_type_is_a(gtype, G_TYPE_PARAM)) {



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