svn commit: samba r21744 - in branches/SAMBA_4_0/source/rpc_server/echo: .

abartlet at samba.org abartlet at samba.org
Wed Mar 7 11:15:44 GMT 2007


Author: abartlet
Date: 2007-03-07 11:15:44 +0000 (Wed, 07 Mar 2007)
New Revision: 21744

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21744

Log:
Test more talloc failure cases.

Andrew Bartlett

Modified:
   branches/SAMBA_4_0/source/rpc_server/echo/rpc_echo.c


Changeset:
Modified: branches/SAMBA_4_0/source/rpc_server/echo/rpc_echo.c
===================================================================
--- branches/SAMBA_4_0/source/rpc_server/echo/rpc_echo.c	2007-03-07 11:05:59 UTC (rev 21743)
+++ branches/SAMBA_4_0/source/rpc_server/echo/rpc_echo.c	2007-03-07 11:15:44 UTC (rev 21744)
@@ -72,7 +72,9 @@
 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 @@
 	}
 	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;
 }



More information about the samba-cvs mailing list