mirror of
https://github.com/tmux/tmux.git
synced 2026-10-16 16:44:30 +00:00
Memory leak fixes from someone in GitHub issues 5739, 5744, 5745, 5746.
This commit is contained in:
5
hooks.c
5
hooks.c
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: hooks.c,v 1.16 2026/07/27 19:15:58 nicm Exp $ */
|
||||
/* $OpenBSD: hooks.c,v 1.17 2026/10/15 08:21:11 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2026 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
@@ -164,6 +164,7 @@ hooks_insert(struct cmdq_item *item, struct hooks_data *hd)
|
||||
break;
|
||||
case CMD_PARSE_SUCCESS:
|
||||
hooks_insert_one(item, hd, pr->cmdlist, state);
|
||||
cmd_list_free(pr->cmdlist);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
@@ -178,10 +179,12 @@ hooks_insert(struct cmdq_item *item, struct hooks_data *hd)
|
||||
cmdq_error(item, "%s",
|
||||
pr->error);
|
||||
}
|
||||
free(pr->error);
|
||||
break;
|
||||
case CMD_PARSE_SUCCESS:
|
||||
item = hooks_insert_one(item, hd,
|
||||
pr->cmdlist, state);
|
||||
cmd_list_free(pr->cmdlist);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: server-client.c,v 1.521 2026/10/15 07:48:05 nicm Exp $ */
|
||||
/* $OpenBSD: server-client.c,v 1.522 2026/10/15 08:21:11 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2009 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
@@ -2757,6 +2757,8 @@ server_client_dispatch_command(struct client *c, struct imsg *imsg)
|
||||
} else {
|
||||
values = args_from_vector(argc, argv);
|
||||
pr = cmd_parse_from_arguments(values, argc, NULL);
|
||||
args_free_values(values, argc);
|
||||
free(values);
|
||||
switch (pr->status) {
|
||||
case CMD_PARSE_ERROR:
|
||||
cause = pr->error;
|
||||
@@ -2764,8 +2766,6 @@ server_client_dispatch_command(struct client *c, struct imsg *imsg)
|
||||
case CMD_PARSE_SUCCESS:
|
||||
break;
|
||||
}
|
||||
args_free_values(values, argc);
|
||||
free(values);
|
||||
cmd_free_argv(argc, argv);
|
||||
if ((c->flags & CLIENT_READONLY) &&
|
||||
!cmd_list_all_have(pr->cmdlist, CMD_READONLY)) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: tty-term.c,v 1.113 2026/10/14 12:33:46 nicm Exp $ */
|
||||
/* $OpenBSD: tty-term.c,v 1.114 2026/10/15 08:21:11 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2008 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
@@ -412,6 +412,8 @@ tty_term_apply(struct tty_term *term, const char *capabilities, int quiet,
|
||||
continue;
|
||||
|
||||
if (remove) {
|
||||
if (code->type == TTYCODE_STRING)
|
||||
free(code->value.string);
|
||||
code->type = TTYCODE_NONE;
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* $OpenBSD: window-customize.c,v 1.37 2026/10/08 07:50:05 nicm Exp $ */
|
||||
/* $OpenBSD: window-customize.c,v 1.38 2026/10/15 08:21:11 nicm Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2020 Nicholas Marriott <nicholas.marriott@gmail.com>
|
||||
@@ -1430,6 +1430,7 @@ monitor:
|
||||
if (wo != NULL && options_owner(o) != wo) {
|
||||
parent = options_get_only(wo, name);
|
||||
if (parent != NULL) {
|
||||
free(value);
|
||||
value = options_to_string(parent, NULL, 0);
|
||||
xsnprintf(label, sizeof label,
|
||||
"Window value (from window %u): ", fs.wl->idx);
|
||||
@@ -1442,6 +1443,7 @@ monitor:
|
||||
if (go != NULL && options_owner(o) != go) {
|
||||
parent = options_get_only(go, name);
|
||||
if (parent != NULL) {
|
||||
free(value);
|
||||
value = options_to_string(parent, NULL, 0);
|
||||
if (!window_customize_write_value(ctx, s->cx, sx,
|
||||
sy - (s->cy - cy), 0, "Global value: ", "%s%s%s",
|
||||
|
||||
Reference in New Issue
Block a user