summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2018-03-07 11:29:05 +0100
committerGravatar Christian Hesse <mail@eworm.de>2018-03-07 11:29:05 +0100
commit527d6a42ef0bf532ef1be3173ddb51937c00e848 (patch)
treea37f70e9f1936ec6d77e8d06da2d199cacd2ff28
parentea2432988cde62b4520e547d8b5d95be489a459a (diff)
downloadnetlink-notify-527d6a42ef0bf532ef1be3173ddb51937c00e848.tar.gz
netlink-notify-527d6a42ef0bf532ef1be3173ddb51937c00e848.tar.zst
properly close the socket
-rw-r--r--netlink-notify.c5
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 ***/