Do not crash when freeing layout cell, reported by Jere Viikari.

This commit is contained in:
nicm
2026-05-24 08:40:43 +00:00
parent 3cfc96d4de
commit f047b3f8e7
4 changed files with 7 additions and 7 deletions

View File

@@ -349,10 +349,8 @@ window_destroy(struct window *w)
window_unzoom(w, 0);
RB_REMOVE(windows, &windows, w);
if (w->layout_root != NULL)
layout_free_cell(w->layout_root);
if (w->saved_layout_root != NULL)
layout_free_cell(w->saved_layout_root);
layout_free_cell(w->layout_root);
layout_free_cell(w->saved_layout_root);
free(w->old_layout);
window_destroy_panes(w);