From: michael Date: Tue, 28 Apr 2015 11:57:32 +0000 (+0000) Subject: - irc.c:irc_parse(): only allocate/deallocate 'source_p' for commands we're actually... X-Git-Tag: 1.0.5~3 X-Git-Url: http://git.serene-ircd.net/?a=commitdiff_plain;h=45a8c3ad873fec195ecac704a34d6bd792c826ab;p=hopm.git - irc.c:irc_parse(): only allocate/deallocate 'source_p' for commands we're actually interted in git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/branches/1.0.x@5862 82007160-df01-0410-b94d-b575c5fd34c7 --- diff --git a/src/irc.c b/src/irc.c index 14c2641..26141a8 100644 --- 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