diff options
author | Volker Lendecke <vl@samba.org> | 2018-01-09 10:23:35 +0100 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2018-01-09 18:25:07 +0100 |
commit | 3022da1a7267f9038f1f0de98d8d54baabd9c567 (patch) | |
tree | 629e96039fa3f482d67604c37cd46b0761c55b19 /source4/libnet | |
parent | e61e9e98e9ff461055daae2fe78f0202f7ed8663 (diff) | |
download | samba-3022da1a7267f9038f1f0de98d8d54baabd9c567.tar.gz |
libnet: Add NULL checks to py_net_finddc
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Diffstat (limited to 'source4/libnet')
-rw-r--r-- | source4/libnet/py_net.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source4/libnet/py_net.c b/source4/libnet/py_net.c index 7ddee2df92c..0567dbd6353 100644 --- 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; } |