From 82afeac7db1a93616d202c49ec491cae718ba370 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 14 Apr 2026 11:25:41 +0000 Subject: [PATCH] Do not leak old time format if it is replaced in same format. --- usr.bin/tmux/format.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/usr.bin/tmux/format.c b/usr.bin/tmux/format.c index 2458be389d8..218e12d0ca2 100644 --- a/usr.bin/tmux/format.c +++ b/usr.bin/tmux/format.c @@ -1,4 +1,4 @@ -/* $OpenBSD: format.c,v 1.358 2026/04/14 07:24:23 nicm Exp $ */ +/* $OpenBSD: format.c,v 1.359 2026/04/14 11:25:41 nicm Exp $ */ /* * Copyright (c) 2011 Nicholas Marriott @@ -5047,8 +5047,10 @@ format_replace(struct format_expand_state *es, const char *key, size_t keylen, if (strchr(fm->argv[0], 'p') != NULL) modifiers |= FORMAT_PRETTY; else if (fm->argc >= 2 && - strchr(fm->argv[0], 'f') != NULL) + strchr(fm->argv[0], 'f') != NULL) { + free(time_format); time_format = format_strip(fm->argv[1]); + } break; case 'q': if (fm->argc < 1)