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 b5a1754..2a14ce0 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 890dc4e..60462ad 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;
 }