all repos — slstatus @ 699f6734d99ac67f9f1dceae2b7aeee8cb105d2f

my build of slstatus (tools.suckless.org/slstatus/)

wifi_perc: Fix file descriptor leak
Aaron Marcher me@drkhsh.at
Wed, 02 May 2018 19:41:53 +0200
commit

699f6734d99ac67f9f1dceae2b7aeee8cb105d2f

parent

af3cdfbbc8dfbdb723fdfef8ac08a89fdee25f2e

1 files changed, 3 insertions(+), 2 deletions(-)

jump to
M components/wifi.ccomponents/wifi.c

@@ -30,10 +30,11 @@ fprintf(stderr, "fopen '%s': %s\n", path,

strerror(errno)); return NULL; } - if(!(p = fgets(status, 5, fp)) || strcmp(status, "up\n") != 0) { + p = fgets(status, 5, fp); + fclose(fp); + if(!p || strcmp(status, "up\n") != 0) { return NULL; } - fclose(fp); if (!(fp = fopen("/proc/net/wireless", "r"))) { fprintf(stderr, "fopen '/proc/net/wireless': %s\n",