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 Alex Rønne Petersen
parent e323dbfd15
commit a4cb636658

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);
}
}