summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm>2015-11-20 22:02:54 +0000
committernicm <nicm>2015-11-20 22:02:54 +0000
commit933929cd622478bb43afe590670613da2e9ff359 (patch)
tree16bd81b16a74bbc0b42d1406f47e39402bc6c503
parent40fefe2cbc92012d4ec5261ce71a57a112c5ec12 (diff)
Memory leaks and an uninitialized part of utf8_data, from Patrick Palka.
-rw-r--r--cmd-if-shell.c1
-rw-r--r--cmd-new-window.c2
-rw-r--r--utf8.c1
3 files changed, 3 insertions, 1 deletions
diff --git a/cmd-if-shell.c b/cmd-if-shell.c
index a9c84261..47f259e7 100644
--- a/cmd-if-shell.c
+++ b/cmd-if-shell.c
@@ -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/cmd-new-window.c b/cmd-new-window.c
index fb89e24f..24204746 100644
--- a/cmd-new-window.c
+++ b/cmd-new-window.c
@@ -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/utf8.c b/utf8.c
index b391c5ec..2210675a 100644
--- a/utf8.c
+++ b/utf8.c
@@ -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;