From 162c06f2f55a0e88623589969af28b1539c3a012 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Wed, 10 Apr 2013 19:25:26 +0200 Subject: [PATCH] Fix cleanup in crypto_tester if a crypter fails --- src/libstrongswan/crypto/crypto_tester.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libstrongswan/crypto/crypto_tester.c b/src/libstrongswan/crypto/crypto_tester.c index 12db0961b..5a0dccced 100644 --- a/src/libstrongswan/crypto/crypto_tester.c +++ b/src/libstrongswan/crypto/crypto_tester.c @@ -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",