mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +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
1 changed files with 1 additions and 1 deletions
|
|
@ -323,7 +323,7 @@ fn serveWebSocket(ws: *WebServer, sock: *http.Server.WebSocket) !noreturn {
|
||||||
// Temporarily unlock, then re-lock after the message is sent.
|
// Temporarily unlock, then re-lock after the message is sent.
|
||||||
ws.time_report_mutex.unlock();
|
ws.time_report_mutex.unlock();
|
||||||
defer ws.time_report_mutex.lock();
|
defer ws.time_report_mutex.lock();
|
||||||
try sock.writeMessage(msg, .binary);
|
try sock.writeMessage(owned_msg, .binary);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue