From 6f99165f6ece6544edcdf1381fea08225033a5d1 Mon Sep 17 00:00:00 2001 From: nicm Date: Thu, 25 Aug 2016 09:33:14 +0000 Subject: [PATCH] Do not crash if display-message used without a client, issue reported by Serge Aleynikov, fix from Thomas Adam. --- usr.bin/tmux/cmd-display-message.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.bin/tmux/cmd-display-message.c b/usr.bin/tmux/cmd-display-message.c index f0a031721a2..4507b15a5e6 100644 --- a/usr.bin/tmux/cmd-display-message.c +++ b/usr.bin/tmux/cmd-display-message.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-display-message.c,v 1.35 2015/12/14 00:31:54 nicm Exp $ */ +/* $OpenBSD: cmd-display-message.c,v 1.36 2016/08/25 09:33:14 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha @@ -78,9 +78,10 @@ cmd_display_message_exec(struct cmd *self, struct cmd_q *cmdq) msg = format_expand_time(ft, template, time(NULL)); if (args_has(self->args, 'p')) cmdq_print(cmdq, "%s", msg); - else + else if (c != NULL) status_message_set(c, "%s", msg); free(msg); + format_free(ft); return (CMD_RETURN_NORMAL); -- 2.20.1