From 52618c2346c4870cbca4529aeee4662b88836f96 Mon Sep 17 00:00:00 2001 From: michael Date: Tue, 28 Apr 2015 11:57:12 +0000 Subject: [PATCH] - 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/trunk@5861 82007160-df01-0410-b94d-b575c5fd34c7 --- src/irc.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) 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 -- 2.30.2