File: src/server/render.zig:166-171
Severity: MEDIUM
Status: ✅ FIXED
ms_ptr.* = null inserted between deinit and re-init so a failed
Screen.init cannot leave the optional pointing at the torn-down screen.
No dedicated failure-injection test (would need a full DisplayClient harness);
the ordering change is covered on the success path by the existing
merged-screen render tests, which all pass.
if (ms_ptr.*) |*ms| { ms.deinit(); } // not nulled
ms_ptr.* = try Screen.init(...); // if this fails → dangling non-null
On init failure the optional still holds a destroyed Screen; the next frame takes the “already sized” branch and renders through freed grids.
if (ms_ptr.*) |*ms| { ms.deinit(); ms_ptr.* = null; }
Add a failure-injection test if practical.