Code

python: Fix a metadata memleak and a missing include (for some versions of python)
authorSven Trenkel <collectd@semidefinite.de>
Wed, 21 Apr 2010 16:12:19 +0000 (18:12 +0200)
committerSven Trenkel <collectd@semidefinite.de>
Wed, 21 Apr 2010 16:12:19 +0000 (18:12 +0200)
src/cpython.h
src/pyvalues.c

index b5a1754a912132931df542e7d6081b98dc688bb3..2a14ce071795ab50c68c2eabcc058bb227e56f5f 100644 (file)
  *   Sven Trenkel <collectd at semidefinite.de>  
  **/
 
+/* Some python versions don't include this by default. */
+
+#include <longintrepr.h>
+
 /* These two macros are basicly Py_BEGIN_ALLOW_THREADS and Py_BEGIN_ALLOW_THREADS
  * from the other direction. If a Python thread calls a C function
  * Py_BEGIN_ALLOW_THREADS is used to allow other python threads to run because
index 890dc4ea6c252c7f803d4b17a6d9d99cd86725b4..60462adb9658dfe73140ce0a6ef90c87b6604a48 100644 (file)
@@ -473,7 +473,7 @@ static meta_data_t *cpy_build_meta(PyObject *meta) {
                if (PyErr_Occurred())
                        cpy_log_exception("building meta data");
                Py_XDECREF(value);
-               Py_DECREF(keystring);
+               Py_DECREF(key);
        }
        return m;
 }