From 1ab135a9424e5c5634c7ae60464b8da3352c597c Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 29 Oct 2025 10:58:56 +0100 Subject: [PATCH] s3:client: Pass down a talloc context to do_host_query() Signed-off-by: Andreas Schneider Reviewed-by: Anoop C S --- source3/client/client.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/source3/client/client.c b/source3/client/client.c index ada39f4f655..ac97577da04 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -6274,14 +6274,15 @@ static int process(TALLOC_CTX *mem_ctx, const char *base_directory) Handle a -L query. ****************************************************************************/ -static int do_host_query(struct loadparm_context *lp_ctx, +static int do_host_query(TALLOC_CTX *mem_ctx, + struct loadparm_context *lp_ctx, const char *query_host) { NTSTATUS status; struct cli_credentials *creds = samba_cmdline_get_creds(); struct smb_transports ts = smbsock_transports_from_port(port); - status = cli_cm_open(talloc_tos(), NULL, + status = cli_cm_open(mem_ctx, NULL, query_host, "IPC$", creds, @@ -6331,7 +6332,7 @@ static int do_host_query(struct loadparm_context *lp_ctx, cli_shutdown(cli); d_printf("Reconnecting with SMB1 for workgroup listing.\n"); lpcfg_set_cmdline(lp_ctx, "client max protocol", "NT1"); - status = cli_cm_open(talloc_tos(), NULL, + status = cli_cm_open(mem_ctx, NULL, query_host, "IPC$", creds, @@ -6801,7 +6802,7 @@ int main(int argc,char *argv[]) sscanf(p, "%x", &name_type); } - rc = do_host_query(lp_ctx, qhost); + rc = do_host_query(frame, lp_ctx, qhost); } else if (message) { rc = do_message_op(creds); } else if (process(frame, base_directory)) { -- 2.47.3