tls: Fix a memory leak if AEAD encryption fails

This commit is contained in:
Martin Willi
2014-10-15 14:21:01 +02:00
parent c0bf721357
commit 867d04b72e
+1
View File
@@ -82,6 +82,7 @@ METHOD(tls_aead_t, encrypt, bool,
assoc = chunk_from_thing(hdr); assoc = chunk_from_thing(hdr);
if (!this->aead->encrypt(this->aead, plain, assoc, iv, NULL)) if (!this->aead->encrypt(this->aead, plain, assoc, iv, NULL))
{ {
chunk_free(&encrypted);
return FALSE; return FALSE;
} }
chunk_free(data); chunk_free(data);