fixed memleak in datetime()

This commit is contained in:
Aaron Marcher authored and Aaron Marcher (drkhsh) committed 2016-08-15 12:43:43 +02:00
1 parent a8d5bde6a5
commit 086a70cde0
1 file changed
+1
+1
View File
@@ -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");
}