From: Volker Lendecke Date: Sun, 18 Aug 2013 19:51:49 +0000 (+0000) Subject: pyldb: Fix CID 1034792 Dereference null return value X-Git-Tag: talloc-2.1.0~140 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cbb5c1ce39640ffd01aeed6d87a57940e344792c;p=thirdparty%2Fsamba.git pyldb: Fix CID 1034792 Dereference null return value Add a NULL check Signed-off-by: Volker Lendecke Reviewed-by: Andrew Bartlett --- diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c index ec6c7d0e542..45831329009 100644 --- a/lib/ldb/pyldb.c +++ b/lib/ldb/pyldb.c @@ -1075,6 +1075,10 @@ static struct ldb_message *PyDict_AsMessage(TALLOC_CTX *mem_ctx, PyObject *dn_value = PyDict_GetItemString(py_obj, "dn"); msg = ldb_msg_new(mem_ctx); + if (msg == NULL) { + PyErr_NoMemory(); + return NULL; + } msg->elements = talloc_zero_array(msg, struct ldb_message_element, PyDict_Size(py_obj)); if (dn_value) {