diff options
| author | Enji Cooper <ngie@FreeBSD.org> | 2017-05-28 07:40:42 +0000 |
|---|---|---|
| committer | Enji Cooper <ngie@FreeBSD.org> | 2017-05-28 07:40:42 +0000 |
| commit | ae442ee64ac67f5d9fc1d4af568fb21a27f71b91 (patch) | |
| tree | dc032ef37c5f7cf75b978cb8a3760ff07c5bf570 | |
| parent | 9ecc1abca3b2fe764d94963f1f8132e7568cf159 (diff) | |
Notes
| -rw-r--r-- | lib/libc/tests/nss/gethostby_test.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/lib/libc/tests/nss/gethostby_test.c b/lib/libc/tests/nss/gethostby_test.c index 214d29a05a2e..39dbb9d9d55a 100644 --- a/lib/libc/tests/nss/gethostby_test.c +++ b/lib/libc/tests/nss/gethostby_test.c @@ -776,24 +776,26 @@ hostent_test_getaddrinfo_eq(struct hostent *he, void *mdata __unused) rv = getaddrinfo(he->h_name, NULL, &hints, &ai); if (rv == 0) { printf("not ok - shouldn't have been resolved\n"); - return (-1); - } + rv = -1; + } else + rv = 0; } else { rv = getaddrinfo(he->h_name, NULL, &hints, &ai); if (rv != 0) { printf("not ok - should have been resolved\n"); - return (-1); + rv = -1; + goto done; } - rv = is_hostent_equal(he, ai); if (rv != 0) { printf("not ok - addrinfo and hostent are not equal\n"); - return (-1); + rv = -1; } - } - - return (0); +done: + if (ai != NULL) + freeaddrinfo(ai); + return (rv); } static int |
