From: Stefan Metzmacher Date: Tue, 27 Feb 2024 15:07:22 +0000 (+0100) Subject: auth/credentials: a temporary MEMORY ccache needs krb5_cc_destroy() X-Git-Tag: tdb-1.4.11~1012 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d221f930efcff09a9b5dc18c5dfb6475ade1312a;p=thirdparty%2Fsamba.git auth/credentials: a temporary MEMORY ccache needs krb5_cc_destroy() A simple krb5_cc_close() doesn't remove it from the global memory list. Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider --- diff --git a/auth/credentials/credentials_krb5.c b/auth/credentials/credentials_krb5.c index c388f6c82df..6841f72c926 100644 --- a/auth/credentials/credentials_krb5.c +++ b/auth/credentials/credentials_krb5.c @@ -109,13 +109,13 @@ static uint32_t smb_gss_krb5_copy_ccache(uint32_t *min_stat, */ maj_stat = gss_krb5_copy_ccache(min_stat, cred, dummy_ccache); if (maj_stat != 0) { - krb5_cc_close(context, dummy_ccache); + krb5_cc_destroy(context, dummy_ccache); return maj_stat; } code = krb5_cc_start_seq_get(context, dummy_ccache, &cursor); if (code != 0) { - krb5_cc_close(context, dummy_ccache); + krb5_cc_destroy(context, dummy_ccache); *min_stat = EINVAL; return GSS_S_FAILURE; } @@ -125,7 +125,7 @@ static uint32_t smb_gss_krb5_copy_ccache(uint32_t *min_stat, &cursor, &creds); if (code != 0) { - krb5_cc_close(context, dummy_ccache); + krb5_cc_destroy(context, dummy_ccache); *min_stat = EINVAL; return GSS_S_FAILURE; } @@ -163,7 +163,7 @@ static uint32_t smb_gss_krb5_copy_ccache(uint32_t *min_stat, krb5_cc_end_seq_get(context, dummy_ccache, &cursor); code = 0; } - krb5_cc_close(context, dummy_ccache); + krb5_cc_destroy(context, dummy_ccache); if (code != 0 || princ == NULL) { krb5_free_cred_contents(context, &creds);