mirror of
https://github.com/znc/znc.git
synced 2026-08-07 01:13:25 +02:00
Fix memory leak. Oops :(.
Found by KindOne on IRC. Thanks!
This commit is contained in:
@@ -315,6 +315,8 @@ public:
|
|||||||
unsigned char randbytes[16];
|
unsigned char randbytes[16];
|
||||||
if (!RAND_bytes(randbytes, padlen)) {
|
if (!RAND_bytes(randbytes, padlen)) {
|
||||||
DEBUG("sasl: DH-AES: Unable to pad");
|
DEBUG("sasl: DH-AES: Unable to pad");
|
||||||
|
free(encrypted_userpass);
|
||||||
|
free(plaintext_userpass);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
memcpy(ptr, randbytes, padlen);
|
memcpy(ptr, randbytes, padlen);
|
||||||
@@ -326,6 +328,8 @@ public:
|
|||||||
unsigned char iv[16], iv_copy[16];
|
unsigned char iv[16], iv_copy[16];
|
||||||
if (!RAND_bytes(iv, sizeof (iv))) {
|
if (!RAND_bytes(iv, sizeof (iv))) {
|
||||||
DEBUG("sasl: DH-AES: Unable to create IV");
|
DEBUG("sasl: DH-AES: Unable to create IV");
|
||||||
|
free(encrypted_userpass);
|
||||||
|
free(plaintext_userpass);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
memcpy(iv_copy, iv, sizeof(iv));
|
memcpy(iv_copy, iv, sizeof(iv));
|
||||||
|
|||||||
Reference in New Issue
Block a user