From 9a74eaa48a8ea43b49421fb0e5cea3ccc26bf27a Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 14 May 2024 06:46:25 +0200 Subject: [PATCH] hostbits: release use_cnt for unix (add|remove)-hostbit Commands would leave use_cnt incremented, never decrementing them. This would lead to a asserting triggering at shutdown. Bug: #7020. (cherry picked from commit d02c57bd1f21873d8a2a78e14a903f2e6c9771c2) --- src/runmode-unix-socket.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/runmode-unix-socket.c b/src/runmode-unix-socket.c index 8b269900e7..20b25f25f9 100644 --- a/src/runmode-unix-socket.c +++ b/src/runmode-unix-socket.c @@ -1280,7 +1280,7 @@ TmEcode UnixSocketHostbitAdd(json_t *cmd, json_t* answer, void *data_usused) Host *host = HostGetHostFromHash(&a); if (host) { HostBitSet(host, idx, SCTIME_SECS(current_time) + expire); - HostUnlock(host); + HostRelease(host); json_object_set_new(answer, "message", json_string("hostbit added")); return TM_ECODE_OK; @@ -1349,7 +1349,7 @@ TmEcode UnixSocketHostbitRemove(json_t *cmd, json_t* answer, void *data_unused) Host *host = HostLookupHostFromHash(&a); if (host) { HostBitUnset(host, idx); - HostUnlock(host); + HostRelease(host); json_object_set_new(answer, "message", json_string("hostbit removed")); return TM_ECODE_OK; } else { @@ -1426,7 +1426,7 @@ TmEcode UnixSocketHostbitList(json_t *cmd, json_t* answer, void *data_unused) bits[use].expire = iter->expire; use++; } - HostUnlock(host); + HostRelease(host); json_t *jdata = json_object(); json_t *jarray = json_array(); -- 2.47.2