tls: Fix a memory leak if AEAD encryption fails
This commit is contained in:
@@ -82,6 +82,7 @@ METHOD(tls_aead_t, encrypt, bool,
|
||||
assoc = chunk_from_thing(hdr);
|
||||
if (!this->aead->encrypt(this->aead, plain, assoc, iv, NULL))
|
||||
{
|
||||
chunk_free(&encrypted);
|
||||
return FALSE;
|
||||
}
|
||||
chunk_free(data);
|
||||
|
||||
Reference in New Issue
Block a user