Fix cleanup in crypto_tester if a crypter fails

This commit is contained in:
Tobias Brunner 2013-04-10 19:25:26 +02:00
parent 9d4fc8677f
commit 162c06f2f5
1 changed files with 4 additions and 1 deletions

View File

@ -265,7 +265,10 @@ METHOD(crypto_tester_t, test_crypter, bool,
failure:
crypter->destroy(crypter);
chunk_free(&cipher);
chunk_free(&plain);
if (plain.ptr != vector->plain)
{
chunk_free(&plain);
}
if (failed)
{
DBG1(DBG_LIB, "disabled %N[%s]: %s test vector failed",