]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pyldb: Check for allocation failure in py_ldb_dn_get_parent()
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Wed, 14 Jun 2023 22:07:56 +0000 (10:07 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 14 Jun 2023 22:57:35 +0000 (22:57 +0000)
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
lib/ldb/pyldb.c

index 223fe77979eb49e32082f533f29dd31a72ef74f4..8981e5ea45c3bdd6b21a8ade77aeea8addba1dfa 100644 (file)
@@ -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) {