X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Fconn.c;h=e57aa2423a3eea2bbdacea0500fe9e3452ddb0bf;hp=46a3ecc2caefe0c1dc5fe41754357aadc08db128;hb=55859c1befa7cd04a130f1816cb73a9629637105;hpb=be97fa8ab1c47a17f6d4c17c69de89d084dc1402 diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c index 46a3ecc2..e57aa242 100644 --- a/src/ngircd/conn.c +++ b/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]"); @@ -1861,10 +1865,10 @@ Check_Connections(void) if (My_Connections[i].lastping < time(NULL) - Conf_PongTimeout) { /* Timeout */ - LogDebug - ("Connection %d: Ping timeout: %d seconds.", - i, Conf_PongTimeout); - snprintf(msg, sizeof(msg), "Ping timeout: %d seconds", Conf_PongTimeout); + snprintf(msg, sizeof(msg), + "Ping timeout: %d seconds", + Conf_PongTimeout); + LogDebug("Connection %d: %s.", i, msg); Conn_Close(i, NULL, msg, true); } } else if (My_Connections[i].lastdata <