diff options
author | Alex Wilson <alex@cooperi.net> | 2014-09-29 14:10:03 +1000 |
---|---|---|
committer | Robert Mustacchi <rm@joyent.com> | 2014-09-29 21:13:35 +0000 |
commit | 6a6aebb06c6a71814688c1fec620c2ab9fa73f3a (patch) | |
tree | 01019a7dcb1aa66954ec2e3010b36118447584fe | |
parent | 1b835011401c6664bbde117b07a1735e0aaf2c74 (diff) | |
download | illumos-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.c | 8 |
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; } |