X-Git-Url: https://git.xinqibao.xyz/slstatus.git/blobdiff_plain/f31b113e7e85bf7057cb88a70d88c5ce9325e208..a18439af114b98ab026921b0cac61164f7a4eea8:/components/ip.c

diff --git a/components/ip.c b/components/ip.c
index 0b6293e..468dc84 100644
--- a/components/ip.c
+++ b/components/ip.c
@@ -31,6 +31,7 @@ ip(const char *iface, unsigned short sa_family)
 		                host, NI_MAXHOST, NULL, 0, NI_NUMERICHOST);
 		if (!strcmp(ifa->ifa_name, iface) &&
 		    (ifa->ifa_addr->sa_family == sa_family)) {
+			freeifaddrs(ifaddr);
 			if (s != 0) {
 				warn("getnameinfo: %s", gai_strerror(s));
 				return NULL;