mirror of
https://github.com/bol-van/zapret.git
synced 2025-05-09 23:32:57 +03:00
nfqws: do not realloc hostname in ipcache if it's the same
This commit is contained in:
parent
ed0bb4c106
commit
603265dac2
13
nfq/desync.c
13
nfq/desync.c
@ -810,13 +810,16 @@ static bool ipcache_put_hostname(const struct in_addr *a4, const struct in6_addr
|
|||||||
DLOG_ERR("ipcache_put_hostname: out of memory\n");
|
DLOG_ERR("ipcache_put_hostname: out of memory\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
free(ipc->hostname);
|
if (!ipc->hostname || strcmp(ipc->hostname,hostname))
|
||||||
if (!(ipc->hostname = strdup(hostname)))
|
|
||||||
{
|
{
|
||||||
DLOG_ERR("ipcache_put_hostname: out of memory\n");
|
free(ipc->hostname);
|
||||||
return false;
|
if (!(ipc->hostname = strdup(hostname)))
|
||||||
|
{
|
||||||
|
DLOG_ERR("ipcache_put_hostname: out of memory\n");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
DLOG("hostname cached: %s\n", hostname);
|
||||||
}
|
}
|
||||||
DLOG("hostname cached: %s\n", hostname);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
static bool ipcache_get_hostname(const struct in_addr *a4, const struct in6_addr *a6, char *hostname, size_t hostname_buf_len)
|
static bool ipcache_get_hostname(const struct in_addr *a4, const struct in6_addr *a6, char *hostname, size_t hostname_buf_len)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user