svn commit: samba r19487 - in branches/SAMBA_3_0/source/rpcclient: .

vlendec at samba.org vlendec at samba.org
Tue Oct 24 20:23:18 GMT 2006


Author: vlendec
Date: 2006-10-24 20:23:14 +0000 (Tue, 24 Oct 2006)
New Revision: 19487

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

Log:
Fix coverity # 313
Modified:
   branches/SAMBA_3_0/source/rpcclient/cmd_echo.c


Changeset:
Modified: branches/SAMBA_3_0/source/rpcclient/cmd_echo.c
===================================================================
--- branches/SAMBA_3_0/source/rpcclient/cmd_echo.c	2006-10-24 20:20:39 UTC (rev 19486)
+++ branches/SAMBA_3_0/source/rpcclient/cmd_echo.c	2006-10-24 20:23:14 UTC (rev 19487)
@@ -100,7 +100,9 @@
 	}
 
 	size = atoi(argv[1]);
-	out_data = (uint8 *)SMB_MALLOC(size);
+	if (!(out_data = (uint8 *)SMB_MALLOC(size))) {
+		return NT_STATUS_NO_MEMORY;
+	}
 
 	result = rpccli_echo_SourceData(cli, mem_ctx, size, out_data);
 
@@ -108,7 +110,7 @@
 		goto done;
 
 	for (i = 0; i < size; i++) {
-		if (out_data && out_data[i] != (i & 0xff)) {
+		if (out_data[i] != (i & 0xff)) {
 			printf("mismatch at offset %d, %d != %d\n",
 			       i, out_data[i], i & 0xff);
 			result = NT_STATUS_UNSUCCESSFUL;



More information about the samba-cvs mailing list