Xinqi Bao's Git
projects
/
slstatus.git
/ diff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
| inline |
side by side
(parent:
a8d5bde
)
fixed memleak in datetime()
author
Aaron Marcher <
[email protected]
>
Mon, 15 Aug 2016 10:43:43 +0000
(12:43 +0200)
committer
Aaron Marcher (drkhsh) <
[email protected]
>
Mon, 15 Aug 2016 10:43:43 +0000
(12:43 +0200)
slstatus.c
diff
|
blob
|
history
diff --git
a/slstatus.c
b/slstatus.c
index
c56efd9
..
6ffc8e0
100644
(file)
--- a/
slstatus.c
+++ b/
slstatus.c
@@
-160,6
+160,7
@@
datetime(const char *timeformat)
setlocale(LC_TIME, "");
if(!strftime(buf, bufsize, timeformat, localtime(&tm))) {
setlocale(LC_TIME, "C");
+ free(buf);
fprintf(stderr, "Strftime failed.\n");
return smprintf("n/a");
}