sssd/backport-KRB5-avoid-another-attempt-to-free-cc-in-done-sectio.patch
fly_fzc bcf7f22f07 backport upstream patches
(cherry picked from commit dfd154fc1eab69ccf7205c936abb022bbd1fb80a)
2023-09-22 17:05:18 +08:00

40 lines
1.2 KiB
Diff

From f6bbd591d636e4309ec37659f825b0f9c53d4b6b Mon Sep 17 00:00:00 2001
From: Alexey Tikhonov <atikhono@redhat.com>
Date: Mon, 19 Jun 2023 20:56:14 +0200
Subject: [PATCH] KRB5: avoid another attempt to free 'cc' in 'done:' section
if first attempt failed.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Reviewed-by: Alejandro López <allopez@redhat.com>
Reviewed-by: Tomáš Halman <thalman@redhat.com>
Reference: https://github.com/SSSD/sssd/commit/f6bbd591d636e4309ec37659f825b0f9c53d4b6b
Conflict: NA
---
src/providers/krb5/krb5_ccache.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/providers/krb5/krb5_ccache.c b/src/providers/krb5/krb5_ccache.c
index 5b80fec52..72c3a23de 100644
--- a/src/providers/krb5/krb5_ccache.c
+++ b/src/providers/krb5/krb5_ccache.c
@@ -637,12 +637,12 @@ errno_t get_ccache_file_data(const char *ccache_file, const char *client_name,
krb5_free_cred_contents(ctx, &cred);
kerr = krb5_cc_close(ctx, cc);
+ cc = NULL;
if (kerr != 0) {
KRB5_DEBUG(SSSDBG_OP_FAILURE, ctx, kerr);
DEBUG(SSSDBG_CRIT_FAILURE, "krb5_cc_close failed.\n");
goto done;
}
- cc = NULL;
kerr = 0;
--
2.27.0