summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2020-03-30 07:42:45 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2020-03-30 07:42:45 +0000
commit8d2feb4387eefe597355843d727e6c6c1d1cb844 (patch)
tree198cc14203266d66563534fe925a3dc177522f11
parent7a87f369fd5bc5a06c0afa53dd7c97b2aa68aa31 (diff)
Do not check flags after the popup struct has been freed.
-rw-r--r--usr.bin/tmux/popup.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.bin/tmux/popup.c b/usr.bin/tmux/popup.c
index 32d4d5df6f7..50f547e7fc2 100644
--- a/usr.bin/tmux/popup.c
+++ b/usr.bin/tmux/popup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: popup.c,v 1.3 2020/03/28 09:51:12 nicm Exp $ */
+/* $OpenBSD: popup.c,v 1.4 2020/03/30 07:42:44 nicm Exp $ */
/*
* Copyright (c) 2020 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -346,9 +346,8 @@ popup_job_complete_cb(struct job *job)
pd->status = 0;
pd->job = NULL;
- if (pd->flags & POPUP_CLOSEEXIT)
- server_client_clear_overlay(pd->c);
- if ((pd->flags & POPUP_CLOSEEXITZERO) && pd->status == 0)
+ if ((pd->flags & POPUP_CLOSEEXIT) ||
+ ((pd->flags & POPUP_CLOSEEXITZERO) && pd->status == 0))
server_client_clear_overlay(pd->c);
}