]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/librbd: fix memory leak in TestCryptoOpensslDataCryptor
authorOr Ozeri <oro@il.ibm.com>
Thu, 25 Nov 2021 13:10:14 +0000 (15:10 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Sun, 13 Feb 2022 15:49:58 +0000 (16:49 +0100)
One of the tests leaks an encryption context.
This commit fixes this issue.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
(cherry picked from commit 09ae3bd03d465af46bfefc03909b91b238d1586f)

src/test/librbd/crypto/openssl/test_DataCryptor.cc

index 69e2b450778eae8ca7420e7e08909f76c4841fca..d3771663bf45fae0ef4bfa9f1469ff47342b9924 100644 (file)
@@ -110,6 +110,7 @@ TEST_F(TestCryptoOpensslDataCryptor, InvalidIVLength) {
   ASSERT_NE(ctx, nullptr);
 
   ASSERT_EQ(-EINVAL, cryptor->init_context(ctx, TEST_IV, 1));
+  cryptor->return_context(ctx, CipherMode::CIPHER_MODE_ENC);
 }
 
 } // namespace openssl