git.samba.org
/
samba.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
pyldb: Fix CID 1034792 Dereference null return value
[samba.git]
/
lib
/
ldb
/
pyldb.c
diff --git
a/lib/ldb/pyldb.c
b/lib/ldb/pyldb.c
index ec6c7d0e542370b92d33a6078253d4fc96dd457f..45831329009e630420993a31f8216c1c6e1fa18a 100644
(file)
--- 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) {