From: Tobias Brunner Date: Wed, 10 Apr 2013 17:25:26 +0000 (+0200) Subject: Fix cleanup in crypto_tester if a crypter fails X-Git-Tag: 5.1.0dr1~149^2~25 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=162c06f2f55a0e88623589969af28b1539c3a012;p=thirdparty%2Fstrongswan.git Fix cleanup in crypto_tester if a crypter fails --- diff --git a/src/libstrongswan/crypto/crypto_tester.c b/src/libstrongswan/crypto/crypto_tester.c index 12db0961b5..5a0dccced8 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",