[pygi] Avoid freeing garbage



commit f9fff978d56ddf2c012b906169ae16abb7fdc2a5
Author: Tomeu Vizoso <tomeu sugarlabs org>
Date:   Wed May 5 08:06:03 2010 +0200

    Avoid freeing garbage

 gi/pygi-invoke.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gi/pygi-invoke.c b/gi/pygi-invoke.c
index aa8c5f3..68db678 100644
--- a/gi/pygi-invoke.c
+++ b/gi/pygi-invoke.c
@@ -841,8 +841,10 @@ _free_invocation_state (struct invocation_state *state)
     }
 
     for (i = 0; i < state->n_args; i++) {
-        g_base_info_unref((GIBaseInfo *)state->arg_type_infos[i]);
-        g_base_info_unref((GIBaseInfo *)state->arg_infos[i]);
+        if (state->arg_type_infos[i] != NULL)
+            g_base_info_unref((GIBaseInfo *)state->arg_type_infos[i]);
+        if (state->arg_infos[i] != NULL)
+            g_base_info_unref((GIBaseInfo *)state->arg_infos[i]);
     }
 
     if (state->arg_infos != NULL) {



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