mirror of
				https://github.com/osmarks/ngircd.git
				synced 2025-10-30 21:42:59 +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:
		| @@ -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]"); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Alexander Barton
					Alexander Barton