[pygobject/invoke-rewrite] [gi-invoke-ng] fix NULL check to check before we access the cache struct



commit db9419fcef628e9ffee10591156007ea9c0bc1f0
Author: John (J5) Palmieri <johnp redhat com>
Date:   Wed Jun 29 12:12:29 2011 -0400

    [gi-invoke-ng] fix NULL check to check before we access the cache struct

 gi/pygi-cache.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gi/pygi-cache.c b/gi/pygi-cache.c
index bf7ac1b..075ec86 100644
--- a/gi/pygi-cache.c
+++ b/gi/pygi-cache.c
@@ -1379,14 +1379,14 @@ _pygi_callable_cache_new (GICallableInfo *callable_info)
     PyGICallableCache *cache = _callable_cache_new_from_callable_info (callable_info);
     GIInfoType type = g_base_info_get_type ( (GIBaseInfo *)callable_info);
 
+    if (cache == NULL)
+        return NULL;
+
     if (type == GI_INFO_TYPE_VFUNC)
         cache->is_vfunc = TRUE;
     else if (type == GI_INFO_TYPE_CALLBACK)
         cache->is_callback = TRUE;
 
-    if (cache == NULL)
-        return NULL;
-
     if (!_args_cache_generate (callable_info, cache))
         goto err;
 



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