summaryrefslogtreecommitdiff
path: root/source4/rpc_server/echo
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-03-05 10:28:24 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:49:14 -0500
commitc069ead0bb543b397542a94fbf4ca836653e2159 (patch)
tree9bc62788928692eb387468b614bd1fce10c1eef7 /source4/rpc_server/echo
parent099a3a7f5224861e04dffbece1db806f35d51fa3 (diff)
downloadsamba-c069ead0bb543b397542a94fbf4ca836653e2159.tar.gz
samba-c069ead0bb543b397542a94fbf4ca836653e2159.tar.bz2
samba-c069ead0bb543b397542a94fbf4ca836653e2159.zip
r21698: Check for talloc failures.
Andrew Bartlett (This used to be commit c9eb5bf19a702af32a4e4f109a27e4076303efdc)
Diffstat (limited to 'source4/rpc_server/echo')
-rw-r--r--source4/rpc_server/echo/rpc_echo.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/source4/rpc_server/echo/rpc_echo.c b/source4/rpc_server/echo/rpc_echo.c
index 7be464935b..8f562b4826 100644
--- a/source4/rpc_server/echo/rpc_echo.c
+++ b/source4/rpc_server/echo/rpc_echo.c
@@ -58,6 +58,9 @@ static NTSTATUS dcesrv_echo_SourceData(struct dcesrv_call_state *dce_call, TALLO
int i;
r->out.data = talloc_array(mem_ctx, uint8_t, r->in.len);
+ if (!r->out.data) {
+ return NT_STATUS_NO_MEMORY;
+ }
for (i=0;i<r->in.len;i++) {
r->out.data[i] = i;
@@ -126,6 +129,9 @@ static NTSTATUS dcesrv_echo_TestSurrounding(struct dcesrv_call_state *dce_call,
}
r->out.data = talloc(mem_ctx, struct echo_Surrounding);
+ if (!r->out.data) {
+ return NT_STATUS_NO_MEMORY;
+ }
r->out.data->x = 2 * r->in.data->x;
r->out.data->surrounding = talloc_zero_array(mem_ctx, uint16_t, r->out.data->x);