Move frees out of mutex lock

This commit is contained in:
Simon Rose authored and Andrew Johnson committed 2026-05-27 09:50:20 -05:00
1 parent 5037f55ad7
commit 73b89cbcd9
1 file changed
+5 -2
+5 -2
View File
@@ -639,19 +639,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)