]> git.ipfire.org Git - people/ms/strongswan.git/commitdiff
Fix cleanup in crypto_tester if a crypter fails
authorTobias Brunner <tobias@strongswan.org>
Wed, 10 Apr 2013 17:25:26 +0000 (19:25 +0200)
committerTobias Brunner <tobias@strongswan.org>
Wed, 8 May 2013 13:02:38 +0000 (15:02 +0200)
src/libstrongswan/crypto/crypto_tester.c

index 12db0961b51a987ae94a9828cb4393bd6fbdbba0..5a0dccced87c26c6b0ad2e9625c900622fc653ab 100644 (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",