summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-05-22 16:40:54 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:08:26 -0500
commit23776d243d94ab878b123afb4ab865557bae1a66 (patch)
tree7281c417422ed1cc529c41ad25fa5b5c837fa8e2
parentab5cbd881307456881b04d13d13e7edfee8e366c (diff)
downloadsamba-23776d243d94ab878b123afb4ab865557bae1a66.tar.gz
samba-23776d243d94ab878b123afb4ab865557bae1a66.tar.bz2
samba-23776d243d94ab878b123afb4ab865557bae1a66.zip
r15811: Fix mget command without arguments. Caught by the IBM Checker.
(This used to be commit c77fd9f515bee07e50cb6acfe02f9f5836f1a67a)
-rw-r--r--source4/client/client.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source4/client/client.c b/source4/client/client.c
index 4672e468ac..20542c0183 100644
--- a/source4/client/client.c
+++ b/source4/client/client.c
@@ -935,7 +935,7 @@ do a mget command
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 @@ static int cmd_mget(struct smbclient_context *ctx, const char **args)
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;
}