diff options
| author | Alexander Barton <alex@barton.de> | 2012-08-26 19:05:08 +0200 |
|---|---|---|
| committer | Alexander Barton <alex@barton.de> | 2012-08-26 19:07:38 +0200 |
| commit | 1680ea02da10dff49748214f6e01538808c7ee65 (patch) | |
| tree | 3fccd91de7d82373d55d1b1558394f4b28dc08fb /src | |
| parent | be97fa8ab1c47a17f6d4c17c69de89d084dc1402 (diff) | |
| download | ngircd-1680ea02da10dff49748214f6e01538808c7ee65.tar.gz ngircd-1680ea02da10dff49748214f6e01538808c7ee65.zip | |
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 ...
Diffstat (limited to 'src')
| -rw-r--r-- | src/ngircd/conn.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ngircd/conn.c b/src/ngircd/conn.c index 46a3ecc2..e7bf1db8 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]"); |