From: Douglas Bagnall Date: Wed, 25 Oct 2023 00:18:34 +0000 (+1300) Subject: lib/ldb: pyldb search iterator avoids exception leak X-Git-Tag: talloc-2.4.2~899 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=cbf8349ec53d0f4e50397149bff3fec5e18004d8;p=thirdparty%2Fsamba.git lib/ldb: pyldb search iterator avoids exception leak Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c index d750a0b97dd..f398887e579 100644 --- a/lib/ldb/pyldb.c +++ b/lib/ldb/pyldb.c @@ -3017,6 +3017,7 @@ static PyObject *py_ldb_search_iterator_result(PyLdbSearchIteratorObject *self, if (self->state.exception != NULL) { PyErr_SetObject(PyExc_LdbError, self->state.exception); + Py_DECREF(self->state.exception); self->state.exception = NULL; return NULL; }