- irc.c:irc_parse(): only allocate/deallocate 'source_p' for commands we're actually...
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Tue, 28 Apr 2015 11:57:32 +0000 (11:57 +0000)
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Tue, 28 Apr 2015 11:57:32 +0000 (11:57 +0000)
git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/branches/1.0.x@5862 82007160-df01-0410-b94d-b575c5fd34c7

src/irc.c

index 14c264140759d5a5491314b388f114734e831354..26141a894cac8736d3f2cd6e0c13ebba5d8f9a9a 100644 (file)
--- a/src/irc.c
+++ b/src/irc.c
@@ -434,7 +434,6 @@ irc_read(void)
 static void
 irc_parse(void)
 {
-  struct UserInfo *source_p;
   char *pos;
 
   /*
@@ -496,9 +495,6 @@ irc_parse(void)
     pos++;
   }
 
-  /* Generate a UserInfo struct from the source */
-  source_p = userinfo_create(parv[0]);
-
   /*
    * Determine which command this is from the command table
    * and let the handler for that command take control
@@ -507,12 +503,14 @@ irc_parse(void)
   {
     if (strcasecmp(cmd->command, parv[1]) == 0)
     {
+      /* Generate a UserInfo struct from the source */
+      struct UserInfo *source_p = userinfo_create(parv[0]);
+
       cmd->handler(parv, parc, msg, source_p);
+      userinfo_free(source_p);
       break;
     }
   }
-
-  userinfo_free(source_p);
 }
 
 /* irc_timer