From 527d6a42ef0bf532ef1be3173ddb51937c00e848 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Wed, 7 Mar 2018 11:29:05 +0100 Subject: properly close the socket --- netlink-notify.c | 5 +++-- 1 file 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 ***/ -- cgit v1.2.3-70-g09d2