From: Todd C. Miller Date: Fri, 18 Jan 2002 19:17:07 +0000 (+0000) Subject: Older BSDi releases lack freeifaddrs() so add a test for that and if X-Git-Tag: SUDO_1_6_6~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=35014b44bc3483f2c5c0ea18ddcc9e615dbce115;p=sudo Older BSDi releases lack freeifaddrs() so add a test for that and if it is not present just use free(). --- diff --git a/config.h.in b/config.h.in index cb873359b..281fc132b 100644 --- a/config.h.in +++ b/config.h.in @@ -79,6 +79,9 @@ /* Define if you have the `fnmatch' function. */ #undef HAVE_FNMATCH +/* Define if you have the `freeifaddrs' function. */ +#undef HAVE_FREEIFADDRS + /* Define if you have the `fstat' function. */ #undef HAVE_FSTAT diff --git a/interfaces.c b/interfaces.c index 34f07770b..8d06d2e46 100644 --- a/interfaces.c +++ b/interfaces.c @@ -157,7 +157,11 @@ load_interfaces() break; } } +#ifdef HAVE_FREEIFADDRS freeifaddrs(ifaddrs); +#else + free(ifaddrs); +#endif } #elif defined(SIOCGIFCONF) && !defined(STUB_LOAD_INTERFACES)