mirror of
https://github.com/NLnetLabs/unbound.git
synced 2026-01-20 21:52:55 -05:00
Merge branch 'master' into edns-string
This commit is contained in:
commit
a4342ceb3a
2 changed files with 16 additions and 4 deletions
|
|
@ -1,3 +1,9 @@
|
|||
10 November 2020: Wouter
|
||||
- Fix #341: fixing a possible memory leak.
|
||||
- Fix memory leak after fix for possible memory leak failure.
|
||||
- Fix #343: Fail to build --with-libnghttp2 with error: 'SSIZE_MAX'
|
||||
undeclared.
|
||||
|
||||
27 October 2020: Wouter
|
||||
- In man page note that tls-cert-bundle is read before permission
|
||||
drop and chroot.
|
||||
|
|
|
|||
|
|
@ -43,6 +43,7 @@
|
|||
# include <sys/types.h>
|
||||
#endif
|
||||
#include <sys/time.h>
|
||||
#include <limits.h>
|
||||
#ifdef USE_TCP_FASTOPEN
|
||||
#include <netinet/tcp.h>
|
||||
#endif
|
||||
|
|
@ -1404,6 +1405,7 @@ static int
|
|||
resolve_ifa_name(struct ifaddrs *ifas, const char *search_ifa, char ***ip_addresses, int *ip_addresses_size)
|
||||
{
|
||||
struct ifaddrs *ifa;
|
||||
void *tmpbuf;
|
||||
int last_ip_addresses_size = *ip_addresses_size;
|
||||
|
||||
for(ifa = ifas; ifa != NULL; ifa = ifa->ifa_next) {
|
||||
|
|
@ -1468,10 +1470,12 @@ resolve_ifa_name(struct ifaddrs *ifas, const char *search_ifa, char ***ip_addres
|
|||
}
|
||||
verbose(4, "interface %s has address %s", search_ifa, addr_buf);
|
||||
|
||||
*ip_addresses = realloc(*ip_addresses, sizeof(char *) * (*ip_addresses_size + 1));
|
||||
if(!*ip_addresses) {
|
||||
tmpbuf = realloc(*ip_addresses, sizeof(char *) * (*ip_addresses_size + 1));
|
||||
if(!tmpbuf) {
|
||||
log_err("realloc failed: out of memory");
|
||||
return 0;
|
||||
} else {
|
||||
*ip_addresses = tmpbuf;
|
||||
}
|
||||
(*ip_addresses)[*ip_addresses_size] = strdup(addr_buf);
|
||||
if(!(*ip_addresses)[*ip_addresses_size]) {
|
||||
|
|
@ -1482,10 +1486,12 @@ resolve_ifa_name(struct ifaddrs *ifas, const char *search_ifa, char ***ip_addres
|
|||
}
|
||||
|
||||
if (*ip_addresses_size == last_ip_addresses_size) {
|
||||
*ip_addresses = realloc(*ip_addresses, sizeof(char *) * (*ip_addresses_size + 1));
|
||||
if(!*ip_addresses) {
|
||||
tmpbuf = realloc(*ip_addresses, sizeof(char *) * (*ip_addresses_size + 1));
|
||||
if(!tmpbuf) {
|
||||
log_err("realloc failed: out of memory");
|
||||
return 0;
|
||||
} else {
|
||||
*ip_addresses = tmpbuf;
|
||||
}
|
||||
(*ip_addresses)[*ip_addresses_size] = strdup(search_ifa);
|
||||
if(!(*ip_addresses)[*ip_addresses_size]) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue