projects
/
dwm-status
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Close fd if there was an empty return.
[dwm-status]
/
dwmstatus.c
diff --git
a/dwmstatus.c
b/dwmstatus.c
index
a8cd4ac
..
1b53292
100644
(file)
--- a/
dwmstatus.c
+++ b/
dwmstatus.c
@@
-106,8
+106,10
@@
readfile(char *base, char *file)
if (fd == NULL)
return NULL;
- if (fgets(line, sizeof(line)-1, fd) == NULL)
+ if (fgets(line, sizeof(line)-1, fd) == NULL) {
+ fclose(fd);
return NULL;
+ }
fclose(fd);
return smprintf("%s", line);