1
0
mirror of https://github.com/osmarks/ngircd.git synced 2024-10-28 04:46:17 +00:00

Free already saved password when storing a new one

This shouldn't happen (clients aren't allowed to send more than one PASS
command), but who knows ...
This commit is contained in:
Alexander Barton 2012-08-26 19:05:08 +02:00
parent be97fa8ab1
commit 1680ea02da

View File

@ -932,6 +932,10 @@ GLOBAL void
Conn_SetPassword( CONN_ID Idx, const char *Pwd )
{
assert( Idx > NONE );
if (My_Connections[Idx].pwd)
free(My_Connections[Idx].pwd);
My_Connections[Idx].pwd = strdup(Pwd);
if (My_Connections[Idx].pwd == NULL) {
Log(LOG_EMERG, "Can't allocate memory! [Conn_SetPassword]");