summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2019-12-15 07:27:45 +0100
committerSébastien Helleu <flashcode@flashtux.org>2019-12-15 07:27:45 +0100
commitbb62485aa96f4be18918ca3f622d70c81c059cc2 (patch)
tree6c77a746d68d7cbab009cfee46c2db2b9a05673d
parent72b107a970a7bed13da040be4515761ddbb1cbb4 (diff)
downloadweechat-bb62485aa96f4be18918ca3f622d70c81c059cc2.zip
irc: fix memory leak when the channel topic is changed
-rw-r--r--ChangeLog.adoc4
-rw-r--r--src/plugins/irc/irc-channel.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc
index 02db35558..83406a077 100644
--- a/ChangeLog.adoc
+++ b/ChangeLog.adoc
@@ -22,6 +22,10 @@ New features::
* api: add info "weechat_headless" (issue #1433)
+Bug fixes::
+
+ * irc: fix memory leak when the channel topic is changed
+
Build::
* irc: fix build with GnuTLS < 3.1.0 (issue #1431)
diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c
index a67358cbe..07244db19 100644
--- a/src/plugins/irc/irc-channel.c
+++ b/src/plugins/irc/irc-channel.c
@@ -557,9 +557,13 @@ irc_channel_set_buffer_title (struct t_irc_channel *channel)
channel->topic,
(weechat_config_boolean (irc_config_look_topic_strip_colors)) ? 0 : 1);
weechat_buffer_set (channel->buffer, "title", title_color);
+ if (title_color)
+ free (title_color);
}
else
+ {
weechat_buffer_set (channel->buffer, "title", "");
+ }
}
/*