[libpeas] Fix possible memory leak in Python loader



commit 348cbd3342f8df18d026459d7925d24f723a4d1f
Author: Garrett Regier <alias301 gmail com>
Date:   Mon Mar 7 01:47:35 2011 -0800

    Fix possible memory leak in Python loader

 loaders/python/peas-plugin-loader-python.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/loaders/python/peas-plugin-loader-python.c b/loaders/python/peas-plugin-loader-python.c
index ab91654..571acfb 100644
--- a/loaders/python/peas-plugin-loader-python.c
+++ b/loaders/python/peas-plugin-loader-python.c
@@ -81,9 +81,9 @@ find_python_extension_type (PeasPluginInfo *info,
 
   pygtype = pyg_type_wrapper_new (exten_type);
   pytype = PyObject_GetAttrString (pygtype, "pytype");
-  g_return_val_if_fail (pytype != NULL, NULL);
+  g_warn_if_fail (pytype != NULL);
 
-  if (pytype != Py_None)
+  if (pytype != NULL && pytype != Py_None)
     {
       while (PyDict_Next (locals, &pos, &key, &value))
         {



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