From 217a375517941ce5d0d2d92beb4604eff8accca2 Mon Sep 17 00:00:00 2001 From: adam- Date: Sat, 1 Aug 2009 08:16:56 +0000 Subject: [PATCH] Fixed some memory leaks when setting vhosts on users git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/stable@2400 5417fbe8-f217-4b02-8779-1006273d7864 --- src/core/hs_on.c | 7 ++++++- src/hostserv.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/core/hs_on.c b/src/core/hs_on.c index 45777930b..35e44bbfb 100644 --- a/src/core/hs_on.c +++ b/src/core/hs_on.c @@ -84,11 +84,16 @@ int do_on(User * u) } anope_cmd_vhost_on(u->nick, vIdent, vHost); if (ircd->vhost) { + if (u->vhost) + free(u->vhost); u->vhost = sstrdup(vHost); } if (ircd->vident) { - if (vIdent) + if (vIdent) { + if (u->vident) + free(u->vident); u->vident = sstrdup(vIdent); + } } set_lastmask(u); } diff --git a/src/hostserv.c b/src/hostserv.c index 87d57642c..fb2bc1282 100644 --- a/src/hostserv.c +++ b/src/hostserv.c @@ -596,11 +596,16 @@ int do_on_id(User * u) } anope_cmd_vhost_on(u->nick, vIdent, vHost); if (ircd->vhost) { + if (u->vhost) + free(u->vhost); u->vhost = sstrdup(vHost); } if (ircd->vident) { - if (vIdent) + if (vIdent) { + if (u->vident) + free(u->vident); u->vident = sstrdup(vIdent); + } } set_lastmask(u); }