# HG changeset patch # User Markus Bröker # Date 1229179222 -3600 # Node ID 213c3d4abc6671d4fde3e088b36d9a6fc5aee842 # Parent a769385a59c61f5c06b328bfaafa3e58ca744e35 A simple garbage collector fills the memory leaks... committer: Markus Bröker diff --git a/debian/changelog b/debian/changelog --- a/debian/changelog +++ b/debian/changelog @@ -1,4 +1,4 @@ -mcbot (0.94-3) unstable; urgency=low +mcbot (0.94-4) unstable; urgency=low * Initial Release * the location of mcbot.cgi is stored in the db @@ -10,5 +10,6 @@ * Debian Policy: Assume everything is working and start the service via default * irc_login connects now to the proper (non-freenode.net) server * privmsgs will be send to the proper location... + * A simple garbage collector fills the memory leaks... - -- Markus Broeker Sat, 9 Aug 2008 18:05:54 +0200 + -- Markus Broeker Sat, 10 Aug 2008 16:48:54 +0200 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;