summaryrefslogtreecommitdiff
path: root/source3/lib/replace/test
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-02-29 02:22:02 +0100
committerMichael Adam <obnox@samba.org>2008-02-29 09:31:50 +0100
commitb6578dc7fedcb98186940dc82d8faccac552a361 (patch)
tree8e64d30b463a0429cc700dd33a931588702ea6d4 /source3/lib/replace/test
parent3be85e76a82c4d67a66e2c6e86a7a9d5c394815f (diff)
downloadsamba-b6578dc7fedcb98186940dc82d8faccac552a361.tar.gz
samba-b6578dc7fedcb98186940dc82d8faccac552a361.tar.bz2
samba-b6578dc7fedcb98186940dc82d8faccac552a361.zip
libreplace: fix silly crashbug in getifaddrs_test().
Michael (cherry picked from commit 523626908d25f974fd1ae6d7306b1d4bc8414162) (This used to be commit 0906120a6e4fe0eb66f3c3fd99c625b30672cb2b)
Diffstat (limited to 'source3/lib/replace/test')
-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;
}