From 072ba365e58e3a0557737d4d873da29184a38632 Mon Sep 17 00:00:00 2001 From: Sven Trenkel Date: Wed, 21 Apr 2010 18:12:19 +0200 Subject: [PATCH] python: Fix a metadata memleak and a missing include (for some versions of python) --- src/cpython.h | 4 ++++ src/pyvalues.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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; } -- 2.11.0