Commits

Anonymous committed b05f854

Fix memory leaks in PASS command, both in normal and repeated use.

Comments (0)

Files changed (1)

 		memset(client_p->localClient->passwd, 0,
 			strlen(client_p->localClient->passwd));
 		rb_free(client_p->localClient->passwd);
+		client_p->localClient->passwd = NULL;
 	}
 
-	client_p->localClient->passwd = rb_strndup(parv[1], PASSWDLEN);
-	
+	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;
+	}
+
 	if ((pass = strchr(buf, ':')) != NULL)
 	{
 		*pass++ = '\0';