diff options
author | Nicholas Marriott <nicm@cvs.openbsd.org> | 2013-10-10 23:31:04 +0000 |
---|---|---|
committer | Nicholas Marriott <nicm@cvs.openbsd.org> | 2013-10-10 23:31:04 +0000 |
commit | efddaeb50ced91014c4f9e83805186bf3e45c3f3 (patch) | |
tree | c472fb79129d3a48f73d948a2139837233667476 /usr.bin | |
parent | f95670a213405b247ed06d9dec0b2700a6be74e1 (diff) |
Fix leak in format_get_command.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/tmux/format.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c index 759f1d4526d..91ee0437345 100644 --- a/usr.bin/tmux/format.c +++ b/usr.bin/tmux/format.c @@ -1,4 +1,4 @@ -/* $OpenBSD: format.c,v 1.36 2013/10/10 12:39:24 nicm Exp $ */ +/* $OpenBSD: format.c,v 1.37 2013/10/10 23:31:03 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott <nicm@users.sourceforge.net> @@ -353,7 +353,7 @@ format_expand(struct format_tree *ft, const char *fmt) char * format_get_command(struct window_pane *wp) { - char *cmd; + char *cmd, *out; cmd = get_proc_name(wp->fd, wp->tty); if (cmd == NULL || *cmd == '\0') { @@ -361,7 +361,9 @@ format_get_command(struct window_pane *wp) if (cmd == NULL || *cmd == '\0') cmd = wp->shell; } - return (parse_window_name(cmd)); + out = parse_window_name(cmd); + free(cmd); + return (out); } /* Set default format keys for a session. */ |