From 4811c7bc6639d74275ae583edde5968a768ee9db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5vard=20Pettersson?= Date: Tue, 18 Nov 2014 16:03:49 +0100 Subject: [PATCH] Prevent crashes in twc_chat_refresh. --- src/twc-chat.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/twc-chat.c b/src/twc-chat.c index aa72c4e..e59b8ab 100644 --- a/src/twc-chat.c +++ b/src/twc-chat.c @@ -156,8 +156,10 @@ twc_chat_refresh(struct t_twc_chat *chat) weechat_buffer_set(chat->buffer, "short_name", name); weechat_buffer_set(chat->buffer, "title", title); - free(name); - free(title); + if (name) + free(name); + if (title && title != name) + free(title); } /**