diff options
author | Volker Lendecke <vl@samba.org> | 2013-08-18 19:51:49 +0000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2013-08-19 11:08:25 +1200 |
commit | cbb5c1ce39640ffd01aeed6d87a57940e344792c (patch) | |
tree | 2c26616ee0f39f576910cb7cd3c0ff1c4080e030 /lib/ldb/pyldb.c | |
parent | 15bd82550dab7a4709e92d639ee563dbc4780366 (diff) | |
download | samba-cbb5c1ce39640ffd01aeed6d87a57940e344792c.tar.gz |
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/ldb/pyldb.c')
-rw-r--r-- | lib/ldb/pyldb.c | 4 |
1 files changed, 4 insertions, 0 deletions
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) { |