From 43ac3d9b44b98d44db9b1550c47e8f96a410d1e9 Mon Sep 17 00:00:00 2001 From: Kai Blin Date: Fri, 14 Dec 2007 14:04:56 +0100 Subject: r26453: Janitorial: Don't use a static char[] in smb_readline_replacement. Fix up callers to free the memory returned, as that is needed if we use the original readline function as well. (This used to be commit c81ead1c38f417d442157b21d0d389f6a540c6f9) --- source4/client/client.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'source4/client') diff --git a/source4/client/client.c b/source4/client/client.c index 748ee2d7cb..65bcfeefb6 100644 --- a/source4/client/client.c +++ b/source4/client/client.c @@ -2997,16 +2997,18 @@ static int process_stdin(struct smbclient_context *ctx) char *the_prompt = talloc_asprintf(ctx, "smb: %s> ", ctx->remote_cur_dir); char *cline = smb_readline(the_prompt, readline_callback, completion_fn); talloc_free(the_prompt); - + if (!cline) break; - + /* special case - first char is ! */ if (*cline == '!') { system(cline + 1); continue; } - rc |= process_command_string(ctx, cline); + rc |= process_command_string(ctx, cline); + free(cline); + } return rc; -- cgit