summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-08-18 19:51:49 +0000
committerAndrew Bartlett <abartlet@samba.org>2013-08-19 11:08:25 +1200
commitcbb5c1ce39640ffd01aeed6d87a57940e344792c (patch)
tree2c26616ee0f39f576910cb7cd3c0ff1c4080e030 /lib
parent15bd82550dab7a4709e92d639ee563dbc4780366 (diff)
downloadsamba-cbb5c1ce39640ffd01aeed6d87a57940e344792c.tar.gz
samba-cbb5c1ce39640ffd01aeed6d87a57940e344792c.tar.bz2
samba-cbb5c1ce39640ffd01aeed6d87a57940e344792c.zip
pyldb: Fix CID 1034792 Dereference null return value
Add a NULL check Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/ldb/pyldb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/ldb/pyldb.c b/lib/ldb/pyldb.c
index ec6c7d0e54..4583132900 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) {