summaryrefslogtreecommitdiff
path: root/components/wifi.c
diff options
context:
space:
mode:
authorAaron Marcher <me@drkhsh.at>2018-01-06 23:37:09 +0100
committerAaron Marcher <me@drkhsh.at>2018-01-06 23:37:09 +0100
commitfa62e8199e32497d48b2f6ef9ecaa798bd53466a (patch)
tree2b9da83eff437ae2e22654c21a635a7765944549 /components/wifi.c
parent47d0073bfd9edfe479700281232db925a5323857 (diff)
Fix a bug in wifi_essid().
When an invalid interface name is passed to wifi_essid() it does not close opened sockets.
Diffstat (limited to 'components/wifi.c')
-rw-r--r--components/wifi.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/components/wifi.c b/components/wifi.c
index 9ecb8e1..3767b21 100644
--- a/components/wifi.c
+++ b/components/wifi.c
@@ -77,6 +77,7 @@ wifi_essid(const char *iface)
wreq.u.essid.pointer = id;
if (ioctl(sockfd,SIOCGIWESSID, &wreq) == -1) {
warn("Failed to get ESSID for interface %s", iface);
+ close(sockfd);
return NULL;
}