mirror of
https://github.com/ziglang/zig.git
synced 2026-02-17 23:10:09 +00:00
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:
parent
d4df65e355
commit
42eb1329b1
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user