summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordx <dx@dxzone.com.ar>2018-03-05 03:44:04 -0300
committerdx <dx@dxzone.com.ar>2018-03-05 03:44:04 -0300
commit327ac5af43ad4ce39465a4872f01b353a1a81870 (patch)
treebb23f953cd70037c5cc3d3edb0a15d5aa21b33cd
parentfc148f2fe97668f951969280066684b9175d8e4b (diff)
downloadpidgin-327ac5af43ad4ce39465a4872f01b353a1a81870.tar.gz
irc: null irc->motd after freeing it
Reported by Joseph Bisch
-rw-r--r--libpurple/protocols/irc/msgs.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libpurple/protocols/irc/msgs.c b/libpurple/protocols/irc/msgs.c
index decec7e5a8..31a57d2ab3 100644
--- a/libpurple/protocols/irc/msgs.c
+++ b/libpurple/protocols/irc/msgs.c
@@ -757,8 +757,10 @@ void irc_msg_motd(struct irc_conn *irc, const char *name, const char *from, char
char *escaped;
if (purple_strequal(name, "375")) {
- if (irc->motd)
+ if (irc->motd) {
g_string_free(irc->motd, TRUE);
+ irc->motd = NULL;
+ }
irc->motd = g_string_new("");
return;
} else if (purple_strequal(name, "376")) {
@@ -770,8 +772,10 @@ void irc_msg_motd(struct irc_conn *irc, const char *name, const char *from, char
/* in case there is no 251, and no MOTD set, finalize the connection.
* (and clear the motd for good measure). */
- if (irc->motd)
+ if (irc->motd) {
g_string_free(irc->motd, TRUE);
+ irc->motd = NULL;
+ }
irc_connected(irc, args[0]);
return;