From: Joseph Sutton Date: Wed, 14 Jun 2023 22:07:56 +0000 (+1200) Subject: pyldb: Check for allocation failure in py_ldb_dn_get_parent() X-Git-Tag: talloc-2.4.1~399 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2eda24663f8b9d6d03bffe96785518d16d06ae6e;p=thirdparty%2Fsamba.git pyldb: Check for allocation failure in py_ldb_dn_get_parent() Signed-off-by: Joseph Sutton Reviewed-by: Andrew Bartlett --- diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c index 223fe77979e..8981e5ea45c 100644 --- a/lib/ldb/pyldb.c +++ b/lib/ldb/pyldb.c @@ -615,6 +615,10 @@ static PyObject *py_ldb_dn_get_parent(PyLdbDnObject *self, } mem_ctx = talloc_new(NULL); + if (mem_ctx == NULL) { + PyErr_NoMemory(); + return NULL; + } parent = ldb_dn_get_parent(mem_ctx, dn); if (parent == NULL) {