summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Marcher <info@nulltime.net>2016-08-15 12:43:43 +0200
committerAaron Marcher (drkhsh) <info@nulltime.net>2016-08-15 12:43:43 +0200
commit086a70cde0a887a55d5554109e483c19bc6ad8c2 (patch)
treed271f57fd8e2170dba8735e7008e7389ed69035d
parenta8d5bde6a52ed5828ff217c8276673720f897c31 (diff)
fixed memleak in datetime()
-rw-r--r--slstatus.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/slstatus.c b/slstatus.c
index c56efd9..6ffc8e0 100644
--- 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");
}