commit 1680ea02da10dff49748214f6e01538808c7ee65 from: Alexander Barton date: Sun Aug 26 17:07:38 2012 UTC 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 ... commit - be97fa8ab1c47a17f6d4c17c69de89d084dc1402 commit + 1680ea02da10dff49748214f6e01538808c7ee65 blob - 46a3ecc2caefe0c1dc5fe41754357aadc08db128 blob + e7bf1db891cba610e4737a4e5f8347e5ff732a36 --- src/ngircd/conn.c +++ src/ngircd/conn.c @@ -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]");