From: nicm Date: Thu, 25 Aug 2016 09:33:14 +0000 (+0000) Subject: Do not crash if display-message used without a client, issue reported by X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6f99165f6ece6544edcdf1381fea08225033a5d1;p=openbsd Do not crash if display-message used without a client, issue reported by Serge Aleynikov, fix from Thomas Adam. --- 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);