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:
parent
be97fa8ab1
commit
1680ea02da
|
@ -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]");
|
||||
|
|
Loading…
Reference in New Issue