Don't read the timestamp after it's freed.

This commit is contained in:
Jordan Bancino 2023-01-16 03:57:01 +00:00
parent c0309c1ea8
commit bd88c01c26

View file

@ -344,6 +344,11 @@ main(int argc, char **argv)
{ {
LogConfigTimeStampFormatSet(lc, tConfig->logTimestamp); LogConfigTimeStampFormatSet(lc, tConfig->logTimestamp);
} }
else
{
Free(tConfig->logTimestamp);
tConfig->logTimestamp = NULL;
}
if (tConfig->flags & TELODENDRIA_LOG_COLOR) if (tConfig->flags & TELODENDRIA_LOG_COLOR)
{ {
@ -610,9 +615,11 @@ finish:
fclose(stdout); fclose(stdout);
} }
TelodendriaConfigFree(tConfig);
DbClose(matrixArgs.db); DbClose(matrixArgs.db);
LogConfigTimeStampFormatSet(lc, NULL);
TelodendriaConfigFree(tConfig);
Log(lc, LOG_DEBUG, ""); Log(lc, LOG_DEBUG, "");
MemoryIterate(TelodendriaMemoryIterator, lc); MemoryIterate(TelodendriaMemoryIterator, lc);
Log(lc, LOG_DEBUG, ""); Log(lc, LOG_DEBUG, "");