summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/replace/test/getifaddrs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/lib/replace/test/getifaddrs.c b/source3/lib/replace/test/getifaddrs.c
index 4455462193..c78c9b545e 100644
--- a/source3/lib/replace/test/getifaddrs.c
+++ b/source3/lib/replace/test/getifaddrs.c
@@ -51,9 +51,11 @@ static const char *format_sockaddr(struct sockaddr *addr,
int getifaddrs_test(void)
{
struct ifaddrs *ifs = NULL;
+ struct ifaddrs *ifs_head = NULL;
int ret;
ret = getifaddrs(&ifs);
+ ifs_head = ifs;
if (ret != 0) {
fprintf(stderr, "getifaddrs() failed: %s\n", strerror(errno));
return 1;
@@ -90,7 +92,7 @@ int getifaddrs_test(void)
ifs = ifs->ifa_next;
}
- freeifaddrs(ifs);
+ freeifaddrs(ifs_head);
return 0;
}