mirror of
https://github.com/osmarks/ngircd.git
synced 2025-07-07 20:32:48 +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:
parent
be97fa8ab1
commit
1680ea02da
@ -932,6 +932,10 @@ GLOBAL void
|
|||||||
Conn_SetPassword( CONN_ID Idx, const char *Pwd )
|
Conn_SetPassword( CONN_ID Idx, const char *Pwd )
|
||||||
{
|
{
|
||||||
assert( Idx > NONE );
|
assert( Idx > NONE );
|
||||||
|
|
||||||
|
if (My_Connections[Idx].pwd)
|
||||||
|
free(My_Connections[Idx].pwd);
|
||||||
|
|
||||||
My_Connections[Idx].pwd = strdup(Pwd);
|
My_Connections[Idx].pwd = strdup(Pwd);
|
||||||
if (My_Connections[Idx].pwd == NULL) {
|
if (My_Connections[Idx].pwd == NULL) {
|
||||||
Log(LOG_EMERG, "Can't allocate memory! [Conn_SetPassword]");
|
Log(LOG_EMERG, "Can't allocate memory! [Conn_SetPassword]");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user