A simple garbage collector fills the memory leaks...
committer: Markus Bröker <mbroeker@largo.homelinux.org>
--- 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 <mbroeker@largo.homelinux.org> Sat, 9 Aug 2008 18:05:54 +0200
+ -- Markus Broeker <mbroeker@largo.homelinux.org> Sat, 10 Aug 2008 16:48:54 +0200
--- 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;