summaryrefslogtreecommitdiffstats
path: root/usr.bin/tmux/names.c
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2021-03-02 11:00:38 +0000
committernicm <nicm@openbsd.org>2021-03-02 11:00:38 +0000
commitc6ae53936380970d43490a262e4af2fc1b12878d (patch)
tree868f312708860fbb6db47abbde131660df872fd8 /usr.bin/tmux/names.c
parentfinish GC old unintuitive interface (diff)
downloadwireguard-openbsd-c6ae53936380970d43490a262e4af2fc1b12878d.tar.xz
wireguard-openbsd-c6ae53936380970d43490a262e4af2fc1b12878d.zip
Do not use NULL active window; also do not leak window name. GitHub
issue 2590 from Chester Liu.
Diffstat (limited to 'usr.bin/tmux/names.c')
-rw-r--r--usr.bin/tmux/names.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/tmux/names.c b/usr.bin/tmux/names.c
index db826680878..01462c4778c 100644
--- a/usr.bin/tmux/names.c
+++ b/usr.bin/tmux/names.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: names.c,v 1.43 2020/10/05 11:04:40 nicm Exp $ */
+/* $OpenBSD: names.c,v 1.44 2021/03/02 11:00:38 nicm Exp $ */
/*
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -109,6 +109,8 @@ default_window_name(struct window *w)
{
char *cmd, *s;
+ if (w->active == NULL)
+ return (xstrdup(""));
cmd = cmd_stringify_argv(w->active->argc, w->active->argv);
if (cmd != NULL && *cmd != '\0')
s = parse_window_name(cmd);