summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Wilson <alex@cooperi.net>2014-09-29 14:10:03 +1000
committerRobert Mustacchi <rm@joyent.com>2014-09-29 21:13:35 +0000
commit6a6aebb06c6a71814688c1fec620c2ab9fa73f3a (patch)
tree01019a7dcb1aa66954ec2e3010b36118447584fe
parent1b835011401c6664bbde117b07a1735e0aaf2c74 (diff)
downloadillumos-joyent-release-20140918.tar.gz
joyent/smartos-live#354 getipnodebyname mistakingly double freesrelease-20140918
Reviewed by: Robert Mustacchi <rm@joyent.com>
-rw-r--r--usr/src/lib/libnsl/nss/getipnodeby.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr/src/lib/libnsl/nss/getipnodeby.c b/usr/src/lib/libnsl/nss/getipnodeby.c
index 3f88993868..f84b641157 100644
--- a/usr/src/lib/libnsl/nss/getipnodeby.c
+++ b/usr/src/lib/libnsl/nss/getipnodeby.c
@@ -362,9 +362,11 @@ getipnodebyname(const char *name, int af, int flags, int *error_num)
* !IPNODE_WANTIPV6.
*/
if (hp != NULL && (ipnode_bits & IPNODE_UNMAP)) {
- struct hostent *input = hp;
- hp = __mappedtov4(input, error_num);
- free(input);
+ /*
+ * Just set hp to a new value, cleanup: will
+ * free the old one
+ */
+ hp = __mappedtov4(hp, error_num);
} else if (hp == NULL)
*error_num = NO_ADDRESS;
}