From: Andreas Schneider Date: Wed, 29 Oct 2025 10:07:08 +0000 (+0100) Subject: s3:client: Pass down a talloc context to process_command_string() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61fe8c907920ab4832cbee58ae47c371fff0d5be;p=thirdparty%2Fsamba.git s3:client: Pass down a talloc context to process_command_string() Signed-off-by: Andreas Schneider Reviewed-by: Anoop C S --- diff --git a/source3/client/client.c b/source3/client/client.c index d8eb662b1b1..7641bd3a83f 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -5786,7 +5786,7 @@ static int cmd_help(void) Process a -c command string. ****************************************************************************/ -static int process_command_string(const char *cmd_in) +static int process_command_string(TALLOC_CTX *mem_ctx, const char *cmd_in) { TALLOC_CTX *frame = talloc_stackframe(); char *cmd = talloc_strdup(frame, cmd_in); @@ -5802,7 +5802,9 @@ static int process_command_string(const char *cmd_in) if (!cli) { NTSTATUS status; - status = cli_cm_open(frame, NULL, + /* cli_cm_open() needs to use a long lived talloc context */ + status = cli_cm_open(mem_ctx, + NULL, desthost, service, creds, @@ -6261,7 +6263,7 @@ static int process(TALLOC_CTX *mem_ctx, const char *base_directory) } if (cmdstr) { - rc = process_command_string(cmdstr); + rc = process_command_string(mem_ctx, cmdstr); } else { rc = process_stdin(); } @@ -6782,7 +6784,7 @@ int main(int argc,char *argv[]) if (tar_to_process(tar_ctx)) { if (cmdstr) - process_command_string(cmdstr); + process_command_string(frame, cmdstr); rc = do_tar_op(frame, base_directory); } else if (query_host && *query_host) { char *qhost = query_host;