]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib/ldb: pyldb search iterator avoids exception leak
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 25 Oct 2023 00:18:34 +0000 (13:18 +1300)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 1 Nov 2023 20:10:46 +0000 (20:10 +0000)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb/pyldb.c

index d750a0b97dd813cd6ea7af6793234e1062dd784d..f398887e579f101c87a8c4f92426257f3126e207 100644 (file)
@@ -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;
        }