>From 6c6c325017fb2cfc1b758cc70e0d9424e5294cf1 Mon Sep 17 00:00:00 2001 From: Matthieu Patou Date: Wed, 26 Dec 2012 21:36:50 -0800 Subject: [PATCH 1/2] pyldb: decrement ref counters on py_results and quiet warnings Signed-off-by: Matthieu Patou --- lib/ldb/pyldb.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c index 8c9d6b9..6c50ccf 100644 --- a/lib/ldb/pyldb.c +++ b/lib/ldb/pyldb.c @@ -3088,6 +3088,10 @@ static int py_module_request(struct ldb_module *mod, struct ldb_request *req) py_result = PyObject_CallMethod(py_ldb, discard_const_p(char, "request"), discard_const_p(char, "")); + if (py_result != NULL) { + Py_DECREF(py_result); + } + return LDB_ERR_OPERATIONS_ERROR; } @@ -3099,6 +3103,10 @@ static int py_module_extended(struct ldb_module *mod, struct ldb_request *req) py_result = PyObject_CallMethod(py_ldb, discard_const_p(char, "extended"), discard_const_p(char, "")); + if (py_result != NULL) { + Py_DECREF(py_result); + } + return LDB_ERR_OPERATIONS_ERROR; } -- 1.7.9.5