mirror of
https://github.com/matrix-construct/construct
synced 2024-11-25 16:22:35 +01:00
Fix memory leaks in PASS command, both in normal and repeated use.
This commit is contained in:
parent
c86ef4438f
commit
15aa08eecb
1 changed files with 9 additions and 2 deletions
|
@ -67,10 +67,17 @@ mr_pass(struct Client *client_p, struct Client *source_p, int parc, const char *
|
|||
memset(client_p->localClient->passwd, 0,
|
||||
strlen(client_p->localClient->passwd));
|
||||
rb_free(client_p->localClient->passwd);
|
||||
client_p->localClient->passwd = NULL;
|
||||
}
|
||||
|
||||
if (client_p->localClient->auth_user)
|
||||
{
|
||||
memset(client_p->localClient->auth_user, 0,
|
||||
strlen(client_p->localClient->auth_user));
|
||||
rb_free(client_p->localClient->auth_user);
|
||||
client_p->localClient->auth_user = NULL;
|
||||
}
|
||||
|
||||
client_p->localClient->passwd = rb_strndup(parv[1], PASSWDLEN);
|
||||
|
||||
if ((pass = strchr(buf, ':')) != NULL)
|
||||
{
|
||||
*pass++ = '\0';
|
||||
|
|
Loading…
Reference in a new issue