From 7ecc8255d6ede9d23bf94e102e28c8b9fd032aed Mon Sep 17 00:00:00 2001 From: nicm Date: Sun, 30 Jun 2019 19:21:53 +0000 Subject: Do not double free window if pane fails to start. --- usr.bin/tmux/spawn.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'usr.bin/tmux/spawn.c') diff --git a/usr.bin/tmux/spawn.c b/usr.bin/tmux/spawn.c index 35894e9f93f..724f4835db4 100644 --- a/usr.bin/tmux/spawn.c +++ b/usr.bin/tmux/spawn.c @@ -1,4 +1,4 @@ -/* $OpenBSD: spawn.c,v 1.5 2019/05/27 12:48:52 nicm Exp $ */ +/* $OpenBSD: spawn.c,v 1.6 2019/06/30 19:21:53 nicm Exp $ */ /* * Copyright (c) 2019 Nicholas Marriott @@ -172,10 +172,8 @@ spawn_window(struct spawn_context *sc, char **cause) /* Spawn the pane. */ wp = spawn_pane(sc, cause); if (wp == NULL) { - if (~sc->flags & SPAWN_RESPAWN) { - window_destroy(w); + if (~sc->flags & SPAWN_RESPAWN) winlink_remove(&s->windows, sc->wl); - } return (NULL); } -- cgit v1.2.3-59-g8ed1b