Browse Source

fixed memleak in datetime()

master
Aaron Marcher 8 years ago
committed by Aaron Marcher (drkhsh)
parent
commit
086a70cde0
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      slstatus.c

+ 1
- 0
slstatus.c View File

@@ -160,6 +160,7 @@ datetime(const char *timeformat)
setlocale(LC_TIME, ""); setlocale(LC_TIME, "");
if(!strftime(buf, bufsize, timeformat, localtime(&tm))) { if(!strftime(buf, bufsize, timeformat, localtime(&tm))) {
setlocale(LC_TIME, "C"); setlocale(LC_TIME, "C");
free(buf);
fprintf(stderr, "Strftime failed.\n"); fprintf(stderr, "Strftime failed.\n");
return smprintf("n/a"); return smprintf("n/a");
} }


Loading…
Cancel
Save