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

abartlet at samba.org abartlet at samba.org
Mon Mar 5 10:28:24 GMT 2007


Author: abartlet
Date: 2007-03-05 10:28:24 +0000 (Mon, 05 Mar 2007)
New Revision: 21698

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

Log:
Check for talloc failures.

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-05 09:54:37 UTC (rev 21697)
+++ branches/SAMBA_4_0/source/rpc_server/echo/rpc_echo.c	2007-03-05 10:28:24 UTC (rev 21698)
@@ -58,6 +58,9 @@
 	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 @@
 	}
 
 	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);
 



More information about the samba-cvs mailing list