From 20e158f076ee5d9a04456441158155925b1de4ee Mon Sep 17 00:00:00 2001 From: Collin Date: Fri, 27 Jun 2025 06:09:32 -0500 Subject: [PATCH] Update log.c --- os/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/os/log.c b/os/log.c index 2f4a1d217..decfeaaa2 100644 --- a/os/log.c +++ b/os/log.c @@ -178,6 +178,7 @@ LogFilePrep(const char *fname, const char *backup, const char *idstring) if (asprintf(&logFileName, fname, idstring) == -1) FatalError("Cannot allocate space for the log file name\n"); + if (backup && *backup) { int fd = open(logFileName, O_RDWR | O_NOFOLLOW); if (fd != -1) { struct stat buf; @@ -197,7 +198,6 @@ LogFilePrep(const char *fname, const char *backup, const char *idstring) } free(oldLog); } - free(oldLog); close(fd); } }