diff --git a/hooks.c b/hooks.c index acc11704d..5cef0b143 100644 --- a/hooks.c +++ b/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 @@ -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 { diff --git a/server-client.c b/server-client.c index 10cc3bee8..e34e819d7 100644 --- a/server-client.c +++ b/server-client.c @@ -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 @@ -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)) { diff --git a/tty-term.c b/tty-term.c index cb2a25f40..135d302c0 100644 --- a/tty-term.c +++ b/tty-term.c @@ -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 @@ -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; } diff --git a/window-customize.c b/window-customize.c index b8ec4f140..f482031b6 100644 --- a/window-customize.c +++ b/window-customize.c @@ -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 @@ -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",