[libpeas] Fix memory leak in python plugin loader



commit 37a8556065119c0e8d1a495b88dd54a869cbfaf6
Author: Garrett Regier <garrettregier gmail com>
Date:   Tue Nov 12 22:50:08 2013 -0800

    Fix memory leak in python plugin loader

 loaders/python/peas-plugin-loader-python.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/loaders/python/peas-plugin-loader-python.c b/loaders/python/peas-plugin-loader-python.c
index 117e035..cdfcee7 100644
--- a/loaders/python/peas-plugin-loader-python.c
+++ b/loaders/python/peas-plugin-loader-python.c
@@ -92,6 +92,7 @@ find_python_extension_type (PeasPluginInfo *info,
           switch (PyObject_IsSubclass (value, pytype))
             {
             case 1:
+              Py_DECREF (pytype);
               Py_DECREF (pygtype);
               return (PyTypeObject *) value;
             case 0:
@@ -104,6 +105,7 @@ find_python_extension_type (PeasPluginInfo *info,
         }
     }
 
+  Py_DECREF (pytype);
   Py_DECREF (pygtype);
 
   return NULL;


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