From: Andreas Schneider Date: Tue, 28 Oct 2025 09:06:25 +0000 (+0100) Subject: s3:client: Always goto out (destructor) in do_cd() X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc15e1a397dbf5fcdebf3aaaabfcbadf4afc8e88;p=thirdparty%2Fsamba.git s3:client: Always goto out (destructor) in do_cd() Signed-off-by: Andreas Schneider Reviewed-by: Anoop C S --- diff --git a/source3/client/client.c b/source3/client/client.c index 690fd3f3f73..1d10a4f90b2 100644 --- a/source3/client/client.c +++ b/source3/client/client.c @@ -399,8 +399,7 @@ static int do_cd(const char *new_dir) newdir = talloc_strdup(ctx, new_dir); if (!newdir) { - TALLOC_FREE(ctx); - return 1; + goto out; } normalize_name(newdir); @@ -409,8 +408,7 @@ static int do_cd(const char *new_dir) saved_dir = talloc_strdup(ctx, client_get_cur_dir()); if (!saved_dir) { - TALLOC_FREE(ctx); - return 1; + goto out; } if (*newdir == CLI_DIRSEP_CHAR) { @@ -447,8 +445,8 @@ static int do_cd(const char *new_dir) } if (strequal(targetpath,CLI_DIRSEP_STR )) { - TALLOC_FREE(ctx); - return 0; + ret = 0; + goto out; }