mirror of
https://github.com/bol-van/zapret.git
synced 2026-01-27 04:40:32 +03:00
tpws: memleak fix
This commit is contained in:
@@ -98,6 +98,7 @@ hostfail_pool *HostFailPoolFind(hostfail_pool *p,const char *s)
|
|||||||
}
|
}
|
||||||
void HostFailPoolDel(hostfail_pool **p, hostfail_pool *elem)
|
void HostFailPoolDel(hostfail_pool **p, hostfail_pool *elem)
|
||||||
{
|
{
|
||||||
|
free(elem->str);
|
||||||
HASH_DEL(*p, elem);
|
HASH_DEL(*p, elem);
|
||||||
free(elem);
|
free(elem);
|
||||||
}
|
}
|
||||||
@@ -108,11 +109,7 @@ void HostFailPoolPurge(hostfail_pool **pp)
|
|||||||
HASH_ITER(hh, *pp, elem, tmp)
|
HASH_ITER(hh, *pp, elem, tmp)
|
||||||
{
|
{
|
||||||
if (now >= elem->expire)
|
if (now >= elem->expire)
|
||||||
{
|
HostFailPoolDel(pp, elem);
|
||||||
free(elem->str);
|
|
||||||
HASH_DEL(*pp, elem);
|
|
||||||
free(elem);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
static time_t host_fail_purge_prev=0;
|
static time_t host_fail_purge_prev=0;
|
||||||
|
|||||||
Reference in New Issue
Block a user