Move frees out of mutex lock

This commit is contained in:
Simon Rose authored and Dirk Zimoch committed 2026-10-13 10:23:57 +02:00
1 parent 6503c86c8b
commit 8999ee7a0b
1 file changed
+5 -2
+5 -2
View File
@@ -667,19 +667,22 @@ void errlogBufResize(struct initArgs config)
}
epicsMutexMustLock(pvt.msgQueueLock);
char *oldlogbuf = pvt.log->base;
char *oldprintbuf = pvt.print->base;
memcpy(logbuf, pvt.log->base, pvt.bufSize);
free(pvt.log->base);
pvt.log->base = logbuf;
memcpy(printbuf, &pvt.print->base, pvt.bufSize);
free(pvt.print->base);
pvt.print->base = printbuf;
pvt.bufSize = config.bufsize;
pvt.maxMsgSize = config.maxMsgSize;
epicsMutexUnlock(pvt.msgQueueLock);
free(oldlogbuf);
free(oldprintbuf);
}
int errlogInit2(int bufsize, int maxMsgSize)