From: Michael Adam Date: Fri, 29 Feb 2008 01:22:02 +0000 (+0100) Subject: libreplace: fix silly crashbug in getifaddrs_test(). X-Git-Tag: samba-3.2.0pre2~37^2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0906120a6e4fe0eb66f3c3fd99c625b30672cb2b;p=thirdparty%2Fsamba.git libreplace: fix silly crashbug in getifaddrs_test(). Michael (cherry picked from commit 523626908d25f974fd1ae6d7306b1d4bc8414162) --- diff --git a/source/lib/replace/test/getifaddrs.c b/source/lib/replace/test/getifaddrs.c index 4455462193d..c78c9b545e2 100644 --- a/source/lib/replace/test/getifaddrs.c +++ b/source/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; }