authorgravatar for mlugg@mlugg.co.ukMatthew Lugg <mlugg@mlugg.co.uk> 2025-08-26 09:49:55+01:00
committergravatar for alex@alexrp.comAlex Rønne Petersen <alex@alexrp.com> 2025-08-26 21:17:38+02:00
loga4cb63665812384376e7730fb7c394b6a38c57f8
tree8f26b14eaea94a084167bf777d04410ee8aeeeca
parente323dbfd1524b64c785a75035ef1d849d478f173
signaturebadge-check Signed by SSH key SHA256:7B/LJ7bpR1eX8aCXSr4mtd5M45VMPKcx9zY8e95b5QM

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.

1 files changed, 1 insertions(+), 1 deletions(-)

lib/std/Build/WebServer.zig+1-1
...@@ -323,7 +323,7 @@ fn serveWebSocket(ws: *WebServer, sock: *http.Server.WebSocket) !noreturn {...@@ -323,7 +323,7 @@ fn serveWebSocket(ws: *WebServer, sock: *http.Server.WebSocket) !noreturn {
323 // Temporarily unlock, then re-lock after the message is sent.323 // Temporarily unlock, then re-lock after the message is sent.
324 ws.time_report_mutex.unlock();324 ws.time_report_mutex.unlock();
325 defer ws.time_report_mutex.lock();325 defer ws.time_report_mutex.lock();
326 try sock.writeMessage(msg, .binary);326 try sock.writeMessage(owned_msg, .binary);
327 }327 }
328 }328 }
329329