src/irc.c
changeset 12 213c3d4abc66
parent 11 a769385a59c6
child 13 d3554afaa768
equal deleted inserted replaced
11:a769385a59c6 12:213c3d4abc66
   140     return 0;
   140     return 0;
   141 }
   141 }
   142 
   142 
   143 static char *irc_getmessage (const char *line, MSG * message)
   143 static char *irc_getmessage (const char *line, MSG * message)
   144 {
   144 {
       
   145     static char *garbage_collector = NULL;
   145     char *theLine;
   146     char *theLine;
   146     char *token;
   147     char *token;
   147     char *ptr;
   148     char *ptr;
   148 
   149 
       
   150     if (garbage_collector != NULL)
       
   151         free (garbage_collector);
       
   152 
   149     if ((theLine = strdup (line)) == NULL)
   153     if ((theLine = strdup (line)) == NULL)
   150         return "ENOMEM";
   154         return "ENOMEM";
       
   155     else
       
   156         garbage_collector = theLine;
   151 
   157 
   152     message->user = message->email = NULL;
   158     message->user = message->email = NULL;
   153     message->command = NULL;
   159     message->command = NULL;
   154     message->channel = message->line = NULL;
   160     message->channel = message->line = NULL;
   155 
   161