diff options
author | 2015-07-17 13:09:07 +0000 | |
---|---|---|
committer | 2015-07-17 13:09:07 +0000 | |
commit | fe6d0ff2b3f0823da84bc9684dfec359d4251195 (patch) | |
tree | 760d1b106285285740ad2a2b687b192053084449 | |
parent | Use an offsets in the array of pollfd structures instead of pointers. No (diff) | |
download | wireguard-openbsd-fe6d0ff2b3f0823da84bc9684dfec359d4251195.tar.xz wireguard-openbsd-fe6d0ff2b3f0823da84bc9684dfec359d4251195.zip |
Do not call window_unzoom from window_destroy because it will try to add
a notification which will get confused because the reference count is
already zero and end up back in window_destroy and a double
free. Instead, just destroy the layouts directly. Noticed by Thomas
Adam.
-rw-r--r-- | usr.bin/tmux/window.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/tmux/window.c b/usr.bin/tmux/window.c index bd25c6f827c..e73ea5a16bb 100644 --- a/usr.bin/tmux/window.c +++ b/usr.bin/tmux/window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: window.c,v 1.134 2015/06/17 16:50:28 nicm Exp $ */ +/* $OpenBSD: window.c,v 1.135 2015/07/17 13:09:07 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net> @@ -341,12 +341,12 @@ window_create(const char *name, int argc, char **argv, const char *path, void window_destroy(struct window *w) { - window_unzoom(w); - RB_REMOVE(windows, &windows, w); if (w->layout_root != NULL) - layout_free(w); + layout_free_cell(w->layout_root); + if (w->saved_layout_root != NULL) + layout_free_cell(w->saved_layout_root); free(w->old_layout); if (event_initialized(&w->name_timer)) |