From: Douglas Bagnall Date: Thu, 14 Mar 2024 04:24:48 +0000 (+1300) Subject: pyldb: py_ldb_dn_add_base() uses PyErr_LDB_DN_OR_RAISE X-Git-Tag: tdb-1.4.11~1208 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b83ea997e759c494847c2f12b1fb667b07e22bc8;p=thirdparty%2Fsamba.git pyldb: py_ldb_dn_add_base() uses PyErr_LDB_DN_OR_RAISE Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c index 47b659fc4f4..3786ca284a7 100644 --- a/lib/ldb/pyldb.c +++ b/lib/ldb/pyldb.c @@ -695,16 +695,18 @@ static PyObject *py_ldb_dn_add_child(PyObject *self, PyObject *args) Py_RETURN_TRUE; } -static PyObject *py_ldb_dn_add_base(PyLdbDnObject *self, PyObject *args) +static PyObject *py_ldb_dn_add_base(PyObject *self, PyObject *args) { PyObject *py_other; - struct ldb_dn *other, *dn; + struct ldb_dn *other = NULL; + struct ldb_dn *dn = NULL; bool ok; + + PyErr_LDB_DN_OR_RAISE(self, dn); + if (!PyArg_ParseTuple(args, "O", &py_other)) return NULL; - dn = pyldb_Dn_AS_DN((PyObject *)self); - if (!pyldb_Object_AsDn(NULL, py_other, ldb_dn_get_ldb_context(dn), &other)) return NULL;