summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoradam- <adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-08-01 08:16:56 +0000
committeradam- <adam-@5417fbe8-f217-4b02-8779-1006273d7864>2009-08-01 08:16:56 +0000
commit217a375517941ce5d0d2d92beb4604eff8accca2 (patch)
tree8249b8b9ee7603afb4da903a5e5415b5f859c364 /src
parent97a42e4f7da424b47619496c1ad4bfaef33a7d1f (diff)
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
Diffstat (limited to 'src')
-rw-r--r--src/core/hs_on.c7
-rw-r--r--src/hostserv.c7
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);
}