From 4f916d0f1adcff235dbd3e0466a209aa07165a9b Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Fri, 20 Nov 2015 22:02:55 +0000 Subject: Memory leaks and an uninitialized part of utf8_data, from Patrick Palka. --- usr.bin/tmux/cmd-if-shell.c | 3 ++- usr.bin/tmux/cmd-new-window.c | 4 ++-- usr.bin/tmux/utf8.c | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/tmux/cmd-if-shell.c b/usr.bin/tmux/cmd-if-shell.c index 2154afafce6..cb360c9de63 100644 --- a/usr.bin/tmux/cmd-if-shell.c +++ b/usr.bin/tmux/cmd-if-shell.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-if-shell.c,v 1.34 2015/10/31 08:13:58 nicm Exp $ */ +/* $OpenBSD: cmd-if-shell.c,v 1.35 2015/11/20 22:02:54 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha @@ -97,6 +97,7 @@ cmd_if_shell_exec(struct cmd *self, struct cmd_q *cmdq) cmd = args->argv[1]; else if (args->argc == 3) cmd = args->argv[2]; + free(shellcmd); if (cmd == NULL) return (CMD_RETURN_NORMAL); if (cmd_string_parse(cmd, &cmdlist, NULL, 0, &cause) != 0) { diff --git a/usr.bin/tmux/cmd-new-window.c b/usr.bin/tmux/cmd-new-window.c index 8a4475193d5..953f59ac6ef 100644 --- a/usr.bin/tmux/cmd-new-window.c +++ b/usr.bin/tmux/cmd-new-window.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-new-window.c,v 1.51 2015/10/31 14:51:15 nicm Exp $ */ +/* $OpenBSD: cmd-new-window.c,v 1.52 2015/11/20 22:02:54 nicm Exp $ */ /* * Copyright (c) 2007 Nicholas Marriott @@ -97,7 +97,7 @@ cmd_new_window_exec(struct cmd *self, struct cmd_q *cmdq) ft = format_create(); format_defaults(ft, cmd_find_client(cmdq, NULL, 1), s, NULL, NULL); - cwd = format_expand(ft, args_get(args, 'c')); + cwd = to_free = format_expand(ft, args_get(args, 'c')); format_free(ft); } else if (cmdq->client != NULL && cmdq->client->session == NULL) cwd = cmdq->client->cwd; diff --git a/usr.bin/tmux/utf8.c b/usr.bin/tmux/utf8.c index 7caf1a7a526..a7685a32cdd 100644 --- a/usr.bin/tmux/utf8.c +++ b/usr.bin/tmux/utf8.c @@ -1,4 +1,4 @@ -/* $OpenBSD: utf8.c,v 1.24 2015/11/14 12:03:23 nicm Exp $ */ +/* $OpenBSD: utf8.c,v 1.25 2015/11/20 22:02:54 nicm Exp $ */ /* * Copyright (c) 2008 Nicholas Marriott @@ -355,6 +355,7 @@ utf8_set(struct utf8_data *ud, u_char ch) u_int i; *ud->data = ch; + ud->have = 1; ud->size = 1; ud->width = 1; -- cgit v1.2.3