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); }