pidgin/pidgin

irc: null irc->motd after freeing it
release-2.x.y
2018-03-05, dx
3236720b4eb7
Parents cda0ef7d24fb
Children 2a3cb906d0c2
irc: null irc->motd after freeing it

Reported by Joseph Bisch
--- a/libpurple/protocols/irc/msgs.c Thu Mar 01 20:38:21 2018 -0600
+++ b/libpurple/protocols/irc/msgs.c Mon Mar 05 03:44:04 2018 -0300
@@ -757,8 +757,10 @@
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 @@
/* 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;