Explorar o código

fixed memleak in datetime()

Aaron Marcher %!s(int64=9) %!d(string=hai) anos
pai
achega
086a70cde0
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      slstatus.c

+ 1 - 0
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");
     }