aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEnji Cooper <ngie@FreeBSD.org>2017-05-28 07:40:42 +0000
committerEnji Cooper <ngie@FreeBSD.org>2017-05-28 07:40:42 +0000
commitae442ee64ac67f5d9fc1d4af568fb21a27f71b91 (patch)
treedc032ef37c5f7cf75b978cb8a3760ff07c5bf570 /lib
parent9ecc1abca3b2fe764d94963f1f8132e7568cf159 (diff)
Notes
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/tests/nss/gethostby_test.c18
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