From 16ac0587a4c7d823be4d947d2bbebdbf445d770c Mon Sep 17 00:00:00 2001 From: bol-van Date: Thu, 8 Jan 2026 18:06:33 +0300 Subject: [PATCH] tpws: memleak fix --- tpws/pools.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tpws/pools.c b/tpws/pools.c index 80063ebe..63ccaf0f 100644 --- a/tpws/pools.c +++ b/tpws/pools.c @@ -98,6 +98,7 @@ hostfail_pool *HostFailPoolFind(hostfail_pool *p,const char *s) } void HostFailPoolDel(hostfail_pool **p, hostfail_pool *elem) { + free(elem->str); HASH_DEL(*p, elem); free(elem); } @@ -108,11 +109,7 @@ void HostFailPoolPurge(hostfail_pool **pp) HASH_ITER(hh, *pp, elem, tmp) { if (now >= elem->expire) - { - free(elem->str); - HASH_DEL(*pp, elem); - free(elem); - } + HostFailPoolDel(pp, elem); } } static time_t host_fail_purge_prev=0;