From: Sven Trenkel Date: Wed, 21 Apr 2010 16:12:19 +0000 (+0200) Subject: python: Fix a metadata memleak and a missing include (for some versions of python) X-Git-Tag: collectd-4.10.0~16^2~1 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=072ba365e58e3a0557737d4d873da29184a38632 python: Fix a metadata memleak and a missing include (for some versions of python) --- diff --git a/src/cpython.h b/src/cpython.h index b5a1754a..2a14ce07 100644 --- a/src/cpython.h +++ b/src/cpython.h @@ -24,6 +24,10 @@ * Sven Trenkel **/ +/* Some python versions don't include this by default. */ + +#include + /* 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 diff --git a/src/pyvalues.c b/src/pyvalues.c index 890dc4ea..60462adb 100644 --- a/src/pyvalues.c +++ b/src/pyvalues.c @@ -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; }