[hackers] [slstatus] Fix a bug in wifi_essid(). || Aaron Marcher

From: <git_AT_suckless.org>
Date: Sat, 6 Jan 2018 23:38:11 +0100 (CET)

commit fa62e8199e32497d48b2f6ef9ecaa798bd53466a
Author: Aaron Marcher <me_AT_drkhsh.at>
AuthorDate: Sat Jan 6 23:37:09 2018 +0100
Commit: Aaron Marcher <me_AT_drkhsh.at>
CommitDate: Sat Jan 6 23:37:09 2018 +0100

    Fix a bug in wifi_essid().
    
    When an invalid interface name is passed to wifi_essid() it does not
    close opened sockets.

diff --git a/components/wifi.c b/components/wifi.c
index 9ecb8e1..3767b21 100644
--- a/components/wifi.c
+++ b/components/wifi.c
_AT_@ -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;
         }
 
Received on Sat Jan 06 2018 - 23:38:11 CET

This archive was generated by hypermail 2.3.0 : Sat Jan 06 2018 - 23:48:22 CET