dpward / rpms / sssd

Forked from rpms/sssd 3 years ago
Clone
Blob Blame History Raw
From bdf461c7577c458d7b2a785b2007c0ccae73e3f7 Mon Sep 17 00:00:00 2001
From: Alexey Tikhonov <atikhono@redhat.com>
Date: Mon, 11 Jan 2021 18:28:02 +0100
Subject: [PATCH] SBUS: do not try to del non existing sender
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Resolves: https://github.com/SSSD/sssd/issues/5425

Reviewed-by: Pavel Březina <pbrezina@redhat.com>
---
 src/sbus/request/sbus_request_sender.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/src/sbus/request/sbus_request_sender.c b/src/sbus/request/sbus_request_sender.c
index cecb188b0..39cdec064 100644
--- a/src/sbus/request/sbus_request_sender.c
+++ b/src/sbus/request/sbus_request_sender.c
@@ -101,10 +101,11 @@ void
 sbus_senders_delete(hash_table_t *table,
                     const char *name)
 {
-    DEBUG(SSSDBG_TRACE_INTERNAL, "Removing identity of sender [%s]\n",
-          name);
-
-    sss_ptr_hash_delete(table, name, true);
+    if (sss_ptr_hash_has_key(table, name)) {
+        DEBUG(SSSDBG_TRACE_INTERNAL, "Removing identity of sender [%s]\n",
+              name);
+        sss_ptr_hash_delete(table, name, true);
+    }
 }
 
 errno_t
-- 
2.21.3