Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
return NULL;
}
py_ret = py_type->tp_alloc(py_type, 0);
+ if (py_ret == NULL) {
+ Py_DECREF(py_type);
+ PyErr_NoMemory();
+ return NULL;
+ }
ret = (PyLdbMessageElementObject *)py_ret;
ret->mem_ctx = talloc_new(NULL);
if (talloc_reference(ret->mem_ctx, new_el) == NULL) {
+ Py_DECREF(py_type);
+ Py_DECREF(py_ret);
PyErr_NoMemory();
return NULL;
}