Xinqi Bao's Git
projects
/
slstatus.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
inline
| side by side
wifi: fixed disconnected wifi status on openbsd
[slstatus.git]
/
components
/
ip.c
diff --git
a/components/ip.c
b/components/ip.c
index
0b6293e
..
f26e49a
100644
(file)
--- a/
components/ip.c
+++ b/
components/ip.c
@@
-1,5
+1,4
@@
/* See LICENSE file for copyright and license details. */
/* See LICENSE file for copyright and license details. */
-#include <errno.h>
#include <ifaddrs.h>
#include <netdb.h>
#include <stdio.h>
#include <ifaddrs.h>
#include <netdb.h>
#include <stdio.h>
@@
-31,6
+30,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)) {
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;
if (s != 0) {
warn("getnameinfo: %s", gai_strerror(s));
return NULL;