diff --git a/src/irc.c b/src/irc.c --- a/src/irc.c +++ b/src/irc.c @@ -142,12 +142,18 @@ static char *irc_getmessage (const char *line, MSG * message) { + static char *garbage_collector = NULL; char *theLine; char *token; char *ptr; + if (garbage_collector != NULL) + free (garbage_collector); + if ((theLine = strdup (line)) == NULL) return "ENOMEM"; + else + garbage_collector = theLine; message->user = message->email = NULL; message->command = NULL;