From: Tobias Brunner Date: Tue, 12 Feb 2013 15:42:45 +0000 (+0100) Subject: Fix cleanup in crypto_tester if AEAD implementation fails X-Git-Tag: 5.0.3dr3~48 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a89ebab62e3807d544fb83278aa9e30d21bda926;p=thirdparty%2Fstrongswan.git Fix cleanup in crypto_tester if AEAD implementation fails --- diff --git a/src/libstrongswan/crypto/crypto_tester.c b/src/libstrongswan/crypto/crypto_tester.c index 08b2264682..12db0961b5 100644 --- a/src/libstrongswan/crypto/crypto_tester.c +++ b/src/libstrongswan/crypto/crypto_tester.c @@ -451,7 +451,10 @@ METHOD(crypto_tester_t, test_aead, bool, failure: aead->destroy(aead); 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",