[pygobject] we shouldn't g_array_free NULL pointers



commit c7c94ef349c30597f2f10d90f74718d678ec7add
Author: John (J5) Palmieri <johnp redhat com>
Date:   Tue Jun 22 14:45:48 2010 -0400

    we shouldn't g_array_free NULL pointers
    
    https://bugzilla.gnome.org/show_bug.cgi?id=622425

 gi/pygi-info.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gi/pygi-info.c b/gi/pygi-info.c
index b7819ca..fc15187 100644
--- a/gi/pygi-info.c
+++ b/gi/pygi-info.c
@@ -1210,8 +1210,9 @@ _wrap_g_field_info_get_value (PyGIBaseInfo *self,
 argument_to_object:
     py_value = _pygi_argument_to_object (&value, field_type_info, GI_TRANSFER_NOTHING);
 
-    if ( (g_type_info_get_tag (field_type_info) == GI_TYPE_TAG_ARRAY) &&
-            (g_type_info_get_array_type (field_type_info) == GI_ARRAY_TYPE_C)) {
+    if ( (value.v_pointer != NULL) &&
+            (g_type_info_get_tag (field_type_info) == GI_TYPE_TAG_ARRAY) &&
+               (g_type_info_get_array_type (field_type_info) == GI_ARRAY_TYPE_C)) {
         g_array_free (value.v_pointer, FALSE);
     }
 



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