Difference for server/plugins.c from version 1.13 to 1.14


version 1.13 version 1.14
Line 1
 
Line 1
 /*  /*
  * static char *rcsid_plugins_c =   * static char *rcsid_plugins_c =
  *   "$Id: plugins.c,v 1.13 2001/12/16 03:31:03 mwedel Exp $";   *   "$Id: plugins.c,v 1.14 2002/02/06 05:54:47 mwedel Exp $";
  */   */
   
 /*****************************************************************************/  /*****************************************************************************/
Line 67
 
Line 67
     CommArray_s *RTNCmd;      CommArray_s *RTNCmd;
   
     strcpy(cmdchar,"command?");      strcpy(cmdchar,"command?");
       /* Why do a malloc/free?  Would be a lot faster to just declare
        * it as a non pointer.
        */
     CmdParm = (CFParm *)(malloc(sizeof(CFParm)));      CmdParm = (CFParm *)(malloc(sizeof(CFParm)));
     CmdParm->Value[0] = cmdchar;      CmdParm->Value[0] = cmdchar;
     CmdParm->Value[1] = cmd;      CmdParm->Value[1] = cmd;
     CmdParm->Value[2] = op;      CmdParm->Value[2] = op;
     RTNCmd = (CommArray_s *)(malloc(sizeof(CommArray_s)));  
   
     for(i=0;i<PlugNR;i++)      for(i=0;i<PlugNR;i++)
     {      {
         RTNValue = PlugList[i].propfunc(CmdParm);          RTNValue = PlugList[i].propfunc(CmdParm);
         if (RTNValue!=NULL)          if (RTNValue!=NULL)
         {          {
        RTNCmd = (CommArray_s *)(malloc(sizeof(CommArray_s)));
             RTNCmd->name = (char *)(RTNValue->Value[0]);              RTNCmd->name = (char *)(RTNValue->Value[0]);
             RTNCmd->func = (CommFunc)(RTNValue->Value[1]);              RTNCmd->func = (CommFunc)(RTNValue->Value[1]);
             RTNCmd->time = *(float *)(RTNValue->Value[2]);              RTNCmd->time = *(float *)(RTNValue->Value[2]);
        /* Note that this is a memory leak here also, because the
         * caller doesn't free this data.  Probably better to
         * make RTNCmd a static - that will work unless this function
         * needs to be recursive or crossfire becomes threaded
         */
        free(CmdParm);
             return RTNCmd;              return RTNCmd;
         };          };
     };      };
       free(CmdParm);
     return NULL;      return NULL;
 };  };
   


Legend:
line(s) removed in v.1.13 
line(s) changed
 line(s) added in v.1.14

File made using version 1.98 of cvs2html by leaf at 2011-07-21 17:43