Move frees out of mutex lock

This commit is contained in:
Simon Rose authored and Dirk Zimoch committed 2026-11-03 16:17:52 +01:00
1 parent 7256244534
commit c5b0d81c2c
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)