svn commit: samba r15811 - in branches/SAMBA_4_0/source/client: .

jelmer at samba.org jelmer at samba.org
Mon May 22 16:40:56 GMT 2006


Author: jelmer
Date: 2006-05-22 16:40:54 +0000 (Mon, 22 May 2006)
New Revision: 15811

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

Log:
Fix mget command without arguments. Caught by the IBM Checker.

Modified:
   branches/SAMBA_4_0/source/client/client.c


Changeset:
Modified: branches/SAMBA_4_0/source/client/client.c
===================================================================
--- branches/SAMBA_4_0/source/client/client.c	2006-05-22 16:32:41 UTC (rev 15810)
+++ branches/SAMBA_4_0/source/client/client.c	2006-05-22 16:40:54 UTC (rev 15811)
@@ -935,7 +935,7 @@
 static int cmd_mget(struct smbclient_context *ctx, const char **args)
 {
 	uint16_t attribute = FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN;
-	char *mget_mask;
+	char *mget_mask = NULL;
 	int i;
 
 	if (ctx->recurse)
@@ -950,14 +950,15 @@
 		if (mget_mask[0] != '\\')
 			mget_mask = talloc_append_string(ctx, mget_mask, "\\");
 		do_list(ctx, mget_mask, attribute,do_mget,False,True);
+
+		talloc_free(mget_mask);
 	}
 
-	if (!*mget_mask) {
+	if (mget_mask == NULL) {
 		mget_mask = talloc_asprintf(ctx, "%s\\*", ctx->remote_cur_dir);
 		do_list(ctx, mget_mask, attribute,do_mget,False,True);
+		talloc_free(mget_mask);
 	}
-
-	talloc_free(mget_mask);
 	
 	return 0;
 }



More information about the samba-cvs mailing list