From a9ac61469175e45c8ba58ae0360306aa06c0cd59 Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 15 Mar 2023 19:23:22 +0000 Subject: [PATCH] Do not leak screen in popups, GitHub issue 3492. --- cmd-display-menu.c | 3 +++ popup.c | 1 + 2 files changed, 4 insertions(+) diff --git a/cmd-display-menu.c b/cmd-display-menu.c index deff4907..4f230ae5 100644 --- a/cmd-display-menu.c +++ b/cmd-display-menu.c @@ -276,6 +276,7 @@ cmd_display_menu_get_position(struct client *tc, struct cmdq_item *item, log_debug("%s: -y: %s = %s = %u (-h %u)", __func__, yp, p, *py, h); free(p); + format_free(ft); return (1); } @@ -470,11 +471,13 @@ cmd_display_popup_exec(struct cmd *self, struct cmdq_item *item) cmd_free_argv(argc, argv); if (env != NULL) environ_free(env); + free(cwd); free(title); return (CMD_RETURN_NORMAL); } if (env != NULL) environ_free(env); + free(cwd); free(title); cmd_free_argv(argc, argv); return (CMD_RETURN_WAIT); diff --git a/popup.c b/popup.c index 250888a8..33325ab2 100644 --- a/popup.c +++ b/popup.c @@ -253,6 +253,7 @@ popup_draw_cb(struct client *c, void *data, struct screen_redraw_ctx *rctx) tty_draw_line(tty, &s, 0, i, pd->sx, px, py + i, &defaults, palette); } + screen_free(&s); if (pd->md != NULL) { c->overlay_check = NULL; c->overlay_data = NULL;