diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2009-01-07 22:40:13 +0100 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2009-01-07 22:40:13 +0100 |
commit | f4735b71807dee7b89fca3ac6f679663ebc22d76 (patch) | |
tree | fc1b4b77de63067d57287dea8f298690e193a13b /source4 | |
parent | 66fa21ef73464188f5cb20e5fc96c5aa35d434b6 (diff) | |
download | samba-f4735b71807dee7b89fca3ac6f679663ebc22d76.tar.gz samba-f4735b71807dee7b89fca3ac6f679663ebc22d76.tar.bz2 samba-f4735b71807dee7b89fca3ac6f679663ebc22d76.zip |
Set proper python exception when running out of memory.
Diffstat (limited to 'source4')
-rw-r--r-- | source4/librpc/rpc/pyrpc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source4/librpc/rpc/pyrpc.c b/source4/librpc/rpc/pyrpc.c index 9863a6aeb5..b841fdad65 100644 --- a/source4/librpc/rpc/pyrpc.c +++ b/source4/librpc/rpc/pyrpc.c @@ -38,12 +38,16 @@ static PyObject *py_dcerpc_run_function(dcerpc_InterfaceObject *iface, struct Py } mem_ctx = talloc_new(NULL); - if (mem_ctx == NULL) + if (mem_ctx == NULL) { + PyErr_NoMemory(); return NULL; + } r = talloc_zero_size(mem_ctx, md->table->calls[md->opnum].struct_size); - if (r == NULL) + if (r == NULL) { + PyErr_NoMemory(); return NULL; + } if (!md->pack_in_data(args, kwargs, r)) { talloc_free(mem_ctx); |