diff options
author | Christian Hesse <mail@eworm.de> | 2018-03-07 11:29:05 +0100 |
---|---|---|
committer | Christian Hesse <mail@eworm.de> | 2018-03-07 11:29:05 +0100 |
commit | 527d6a42ef0bf532ef1be3173ddb51937c00e848 (patch) | |
tree | a37f70e9f1936ec6d77e8d06da2d199cacd2ff28 | |
parent | ea2432988cde62b4520e547d8b5d95be489a459a (diff) | |
download | netlink-notify-527d6a42ef0bf532ef1be3173ddb51937c00e848.tar.gz netlink-notify-527d6a42ef0bf532ef1be3173ddb51937c00e848.tar.zst |
properly close the socket
-rw-r--r-- | netlink-notify.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/netlink-notify.c b/netlink-notify.c index bc41954..f1de621 100644 --- a/netlink-notify.c +++ b/netlink-notify.c @@ -124,8 +124,9 @@ void get_ssid(const char *interface, char *essid) { if ((sockfd = socket(AF_INET, SOCK_DGRAM, 0)) == -1) return; - if (ioctl(sockfd, SIOCGIWESSID, &wreq) == -1) - return; + ioctl(sockfd, SIOCGIWESSID, &wreq); + + close(sockfd); } /*** newstr_link ***/ |