Severity: HIGH Status: ✅ RESOLVED
addSixelImage begins with errdefer self.allocator.free(dcs_bytes) (:223) — correct until ownership transfers. placeSixelImage stores the slice into the slot at :340 (self.sixel_images[slot] = SixelImage{ .data = dcs_bytes, ... }) and then performs fallible work: try self.grid.scrollUp() in the marker loop (:367) and the final repositioning loop. If either fails (OOM from the backing GPA), the errdefer frees bytes the slot still references:
old.deinit(self.allocator) (:336) → free of already-freed memory;Screen.deinit (:176-180) → same;findSixelImage can render the dangling data meanwhile (use-after-free).flushPendingSixel (:205-210) has the same shape and its comment merely acknowledges the loss.
Fix: disarm the errdefer the moment the slice is placed into the slot (pass a *bool owned, or split placement so the first fallible call happens before storing).