diff options
-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; } |