summaryrefslogtreecommitdiff
path: root/src/protocol/ptlink.c
diff options
context:
space:
mode:
authorcertus certus@31f1291d-b8d6-0310-a050-a5561fc1590b <certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2006-03-01 14:08:00 +0000
committercertus certus@31f1291d-b8d6-0310-a050-a5561fc1590b <certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2006-03-01 14:08:00 +0000
commit88b67f00f7c5036990492e6b64f2f7caa5b98583 (patch)
tree5b52b3c13c5c4e8e1445d423f0edae2feaf65288 /src/protocol/ptlink.c
parent3a61b5a6064e2cd260af9d35e9f288c089bfc2f6 (diff)
git-svn-id: svn://svn.anope.org/anope/trunk@981 31f1291d-b8d6-0310-a050-a5561fc1590b
git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@706 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'src/protocol/ptlink.c')
-rw-r--r--src/protocol/ptlink.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/protocol/ptlink.c b/src/protocol/ptlink.c
index 13f1ba7b3..8b7039941 100644
--- a/src/protocol/ptlink.c
+++ b/src/protocol/ptlink.c
@@ -418,6 +418,7 @@ int anope_event_newmask(char *source, int ac, char **av)
{
User *u;
char *newhost = NULL, *newuser = NULL;
+ int tofree = 0;
if (ac != 1)
return MOD_CONT;
@@ -445,7 +446,9 @@ int anope_event_newmask(char *source, int ac, char **av)
newuser = myStrGetOnlyToken(av[0], '@', 0);
if (newuser) {
newhost = myStrGetTokenRemainder(av[0], '@', 1);
+ tofree = 1;
change_user_username(u, newuser);
+ free(newuser);
} else {
newhost = av[0];
}
@@ -455,9 +458,11 @@ int anope_event_newmask(char *source, int ac, char **av)
u->mode |= UMODE_VH;
- if (newhost) {
+ if (newhost)
change_user_host(u, newhost);
- }
+
+ if (tofree)
+ free(newhost);
return MOD_CONT;
}