From d221f930efcff09a9b5dc18c5dfb6475ade1312a Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 27 Feb 2024 16:07:22 +0100 Subject: [PATCH] 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 --- auth/credentials/credentials_krb5.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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);