std.Build.WebServer: fix race

Just a typo: I wasn't actually using the duped message, so the message I
sent could be freed in this interval.
This commit is contained in:
mlugg 2025-08-26 09:49:55 +01:00 committed by Matthew Lugg
parent d4df65e355
commit 42eb1329b1

View file

@ -323,7 +323,7 @@ fn serveWebSocket(ws: *WebServer, sock: *http.Server.WebSocket) !noreturn {
// Temporarily unlock, then re-lock after the message is sent.
ws.time_report_mutex.unlock();
defer ws.time_report_mutex.lock();
try sock.writeMessage(msg, .binary);
try sock.writeMessage(owned_msg, .binary);
}
}