From 314f0ae9649134ad508306199c75b2f4a7e4a2bb Mon Sep 17 00:00:00 2001 From: nicm Date: Wed, 22 Apr 2026 07:03:06 +0000 Subject: [PATCH] Do not leak hyperlinks in copy mode, from Barrett Ruth in GitHub issue 5020. --- window-copy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/window-copy.c b/window-copy.c index 16626563..ac89dc56 100644 --- a/window-copy.c +++ b/window-copy.c @@ -463,8 +463,10 @@ window_copy_init(struct window_mode_entry *wme, data->scroll_exit = args_has(args, 'e'); data->hide_position = args_has(args, 'H'); - if (base->hyperlinks != NULL) + if (base->hyperlinks != NULL) { + hyperlinks_free(data->screen.hyperlinks); data->screen.hyperlinks = hyperlinks_copy(base->hyperlinks); + } data->screen.cx = data->cx; data->screen.cy = data->cy; data->mx = data->cx;