summaryrefslogtreecommitdiffstats
path: root/format.c
diff options
context:
space:
mode:
authornicm <nicm>2013-10-10 23:31:03 +0000
committernicm <nicm>2013-10-10 23:31:03 +0000
commit0b77d17b35fad797b26632f3305dcd2c9b994a3f (patch)
tree56793c953b6d2e54e711844efe236e0ebaeadefc /format.c
parentd0566a474aa43cb27c6a8fc62ff80ef32c7fe86e (diff)
Fix leak in format_get_command.
Diffstat (limited to 'format.c')
-rw-r--r--format.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/format.c b/format.c
index 40957a59..14dcd000 100644
--- a/format.c
+++ b/format.c
@@ -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. */