From 85a11bc1bbf41d17d38343e9c2707604287b6f58 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 7 Mar 2007 11:15:44 +0000 Subject: r21744: Test more talloc failure cases. Andrew Bartlett (This used to be commit ddf7354986a800455b6f55c2fdbeb8bb39381716) --- source4/rpc_server/echo/rpc_echo.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source4') 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; } -- cgit