From: Volker Lendecke Date: Mon, 30 Sep 2024 09:05:20 +0000 (+0200) Subject: auth4: Fix CID 1034877 Resource leak X-Git-Tag: tdb-1.4.13~1017 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=dea292c2fdb4a629c7d488b0bca636856309626b;p=thirdparty%2Fsamba.git auth4: Fix CID 1034877 Resource leak Signed-off-by: Volker Lendecke Reviewed-by: Andreas Schneider Autobuild-User(master): Volker Lendecke Autobuild-Date(master): Wed Oct 2 14:19:08 UTC 2024 on atb-devel-224 --- diff --git a/source4/auth/session.c b/source4/auth/session.c index 9c9d8c4aaff..8f5d58b3437 100644 --- a/source4/auth/session.c +++ b/source4/auth/session.c @@ -365,6 +365,7 @@ struct auth_session_info *auth_session_info_from_transport(TALLOC_CTX *mem_ctx, creds = cli_credentials_init(session_info); if (!creds) { + gss_release_cred(&minor_status, &cred_handle); *reason = "Out of memory in cli_credentials_init()"; return NULL; } @@ -372,6 +373,7 @@ struct auth_session_info *auth_session_info_from_transport(TALLOC_CTX *mem_ctx, ok = cli_credentials_set_conf(creds, lp_ctx); if (!ok) { + gss_release_cred(&minor_status, &cred_handle); *reason = "Failed to load smb.conf"; return NULL; } @@ -385,6 +387,7 @@ struct auth_session_info *auth_session_info_from_transport(TALLOC_CTX *mem_ctx, CRED_SPECIFIED, &error_string); if (ret) { + gss_release_cred(&minor_status, &cred_handle); *reason = talloc_asprintf(mem_ctx, "Failed to set pipe forwarded " "creds: %s\n", error_string);