s4/pyrpc_util: catch alloc failure in py_dcerpc_interface_init_helper()
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 2 May 2018 21:57:29 +0000 (09:57 +1200)
committerNoel Power <npower@samba.org>
Tue, 29 Jan 2019 12:45:32 +0000 (13:45 +0100)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <npower@samba.org>
source4/librpc/rpc/pyrpc_util.c

index 70274f0268e52e7fe5770c152563261cf710449f..6dadc214ea52de1460c18008a7a9901f2a879856 100644 (file)
@@ -116,6 +116,11 @@ PyObject *py_dcerpc_interface_init_helper(PyTypeObject *type, PyObject *args, Py
        }
 
        ret = PyObject_New(dcerpc_InterfaceObject, type);
+       if (ret == NULL) {
+               PyErr_NoMemory();
+               return NULL;
+       }
+
        ret->pipe = NULL;
        ret->binding_handle = NULL;
        ret->mem_ctx = talloc_new(NULL);