From 7f308c6fe01408fa6beb48b9f7627068968da771 Mon Sep 17 00:00:00 2001
From: Alexey Tikhonov <atikhono@redhat.com>
Date: Mon, 19 Jun 2023 21:46:08 +0200
Subject: [PATCH] KRB5: avoid FORWARD_NULL
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/7f308c6fe01408fa6beb48b9f7627068968da771
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 20d932e53..88f75a8d8 100644
--- a/src/providers/krb5/krb5_ccache.c
+++ b/src/providers/krb5/krb5_ccache.c
@@ -788,7 +788,7 @@ done:
         DEBUG(SSSDBG_OP_FAILURE, "krb5_cc_close failed.\n");
     }
 
-    if (krb5_cc_close(kctx, mem_ccache) != 0) {
+    if ((mem_ccache != NULL) && (krb5_cc_close(kctx, mem_ccache) != 0)) {
         DEBUG(SSSDBG_OP_FAILURE, "krb5_cc_close failed.\n");
     }
 
-- 
2.27.0

