diff options
author | Andrew Bartlett <abartlet@samba.org> | 2007-03-07 11:15:44 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:49:22 -0500 |
commit | 85a11bc1bbf41d17d38343e9c2707604287b6f58 (patch) | |
tree | e0cec88be25c2c040b0e34ab7eaf5b7f9d72cbc1 /source4 | |
parent | 45be80844e9a3ce888bd6a67b224e14517c4d93d (diff) | |
download | samba-85a11bc1bbf41d17d38343e9c2707604287b6f58.tar.gz samba-85a11bc1bbf41d17d38343e9c2707604287b6f58.tar.bz2 samba-85a11bc1bbf41d17d38343e9c2707604287b6f58.zip |
r21744: Test more talloc failure cases.
Andrew Bartlett
(This used to be commit ddf7354986a800455b6f55c2fdbeb8bb39381716)
Diffstat (limited to 'source4')
-rw-r--r-- | source4/rpc_server/echo/rpc_echo.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c index 8f562b4826..1e80e91641 100644 --- a/source4/rpc_server/echo/rpc_echo.c +++ b/source4/rpc_server/echo/rpc_echo.c @@ -72,7 +72,9 @@ static NTSTATUS dcesrv_echo_SourceData(struct dcesrv_call_state *dce_call, TALLO static NTSTATUS dcesrv_echo_TestCall(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct echo_TestCall *r) { *r->out.s2 = talloc_strdup(mem_ctx, r->in.s1); - + if (r->in.s1 && !*r->out.s2) { + return NT_STATUS_NO_MEMORY; + } return NT_STATUS_OK; } @@ -134,6 +136,9 @@ static NTSTATUS dcesrv_echo_TestSurrounding(struct dcesrv_call_state *dce_call, } r->out.data->x = 2 * r->in.data->x; r->out.data->surrounding = talloc_zero_array(mem_ctx, uint16_t, r->out.data->x); + if (!r->out.data->surrounding) { + return NT_STATUS_NO_MEMORY; + } return NT_STATUS_OK; } |