diff options
author | Renato Botelho <renato@netgate.com> | 2016-06-21 07:44:54 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2016-06-21 07:44:54 -0300 |
commit | 1fc6b0207cc2f3cce33817706603caa41a9de24d (patch) | |
tree | d2d812b76b08f42a002621f716dd5f3199c7ca7d /lib/libc | |
parent | b8632c4f34175c7018be77059ab229e755eb67e0 (diff) | |
parent | bc9e0dd07a76c4d7a1c6fcf21824ca2cecff2c6d (diff) | |
download | FreeBSD-src-1fc6b0207cc2f3cce33817706603caa41a9de24d.zip FreeBSD-src-1fc6b0207cc2f3cce33817706603caa41a9de24d.tar.gz |
Merge remote-tracking branch 'origin/stable/10' into devel
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/gen/getnetgrent.c | 2 | ||||
-rw-r--r-- | lib/libc/resolv/res_init.c | 25 | ||||
-rw-r--r-- | lib/libc/sys/jail.2 | 2 |
3 files changed, 16 insertions, 13 deletions
diff --git a/lib/libc/gen/getnetgrent.c b/lib/libc/gen/getnetgrent.c index 4bf0a14..8aa75e2 100644 --- a/lib/libc/gen/getnetgrent.c +++ b/lib/libc/gen/getnetgrent.c @@ -615,6 +615,8 @@ read_for_group(const char *group) if (linep == NULL) { free(lp->l_groupname); free(lp); + if (olen > 0) + free(olinep); return (NULL); } if (olen > 0) { diff --git a/lib/libc/resolv/res_init.c b/lib/libc/resolv/res_init.c index 41e9f5a..715b654 100644 --- a/lib/libc/resolv/res_init.c +++ b/lib/libc/resolv/res_init.c @@ -412,20 +412,21 @@ __res_vinit(res_state statp, int preinit) { hints.ai_socktype = SOCK_DGRAM; /*dummy*/ hints.ai_flags = AI_NUMERICHOST; sprintf(sbuf, "%u", NAMESERVER_PORT); - if (getaddrinfo(cp, sbuf, &hints, &ai) == 0 && - ai->ai_addrlen <= minsiz) { - if (statp->_u._ext.ext != NULL) { - memcpy(&statp->_u._ext.ext->nsaddrs[nserv], - ai->ai_addr, ai->ai_addrlen); + if (getaddrinfo(cp, sbuf, &hints, &ai) == 0) { + if (ai->ai_addrlen <= minsiz) { + if (statp->_u._ext.ext != NULL) { + memcpy(&statp->_u._ext.ext->nsaddrs[nserv], + ai->ai_addr, ai->ai_addrlen); + } + if (ai->ai_addrlen <= + sizeof(statp->nsaddr_list[nserv])) { + memcpy(&statp->nsaddr_list[nserv], + ai->ai_addr, ai->ai_addrlen); + } else + statp->nsaddr_list[nserv].sin_family = 0; + nserv++; } - if (ai->ai_addrlen <= - sizeof(statp->nsaddr_list[nserv])) { - memcpy(&statp->nsaddr_list[nserv], - ai->ai_addr, ai->ai_addrlen); - } else - statp->nsaddr_list[nserv].sin_family = 0; freeaddrinfo(ai); - nserv++; } } continue; diff --git a/lib/libc/sys/jail.2 b/lib/libc/sys/jail.2 index a2d692a..df19e49 100644 --- a/lib/libc/sys/jail.2 +++ b/lib/libc/sys/jail.2 @@ -106,7 +106,7 @@ pointers can be set to an arrays of IPv4 and IPv6 addresses to be assigned to the prison, or NULL if none. IPv4 addresses must be in network byte order. .Pp -This is equivalent to the +This is equivalent to, and deprecated in favor of, the .Fn jail_set system call (see below), with the parameters .Va path , |