git.samba.org
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
e61e9e9
)
libnet: Add NULL checks to py_net_finddc
author
Volker Lendecke
<vl@samba.org>
Tue, 9 Jan 2018 09:23:35 +0000
(10:23 +0100)
committer
Volker Lendecke
<vl@samba.org>
Tue, 9 Jan 2018 17:25:07 +0000
(18:25 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source4/libnet/py_net.c
patch
|
blob
|
history
diff --git
a/source4/libnet/py_net.c
b/source4/libnet/py_net.c
index 7ddee2df92c6ef5b84f4bcecb272f1ee10342fc7..0567dbd6353d0c6328f8ac6ee532782e7fd514cb 100644
(file)
--- a/
source4/libnet/py_net.c
+++ b/
source4/libnet/py_net.c
@@
-697,8
+697,18
@@
static PyObject *py_net_finddc(py_net_Object *self, PyObject *args, PyObject *kw
}
mem_ctx = talloc_new(self->mem_ctx);
+ if (mem_ctx == NULL) {
+ PyErr_NoMemory();
+ return NULL;
+ }
io = talloc_zero(mem_ctx, struct finddcs);
+ if (io == NULL) {
+ TALLOC_FREE(mem_ctx);
+ PyErr_NoMemory();
+ return NULL;
+ }
+
if (domain != NULL) {
io->in.domain_name = domain;
}