From b29be7fbd9e37c7610c98f7f3c4e69ea2898ae2e Mon Sep 17 00:00:00 2001 From: Or Ozeri Date: Thu, 25 Nov 2021 15:10:14 +0200 Subject: [PATCH] test/librbd: fix memory leak in TestCryptoOpensslDataCryptor One of the tests leaks an encryption context. This commit fixes this issue. Signed-off-by: Or Ozeri (cherry picked from commit 09ae3bd03d465af46bfefc03909b91b238d1586f) --- src/test/librbd/crypto/openssl/test_DataCryptor.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/librbd/crypto/openssl/test_DataCryptor.cc b/src/test/librbd/crypto/openssl/test_DataCryptor.cc index 69e2b450778ea..d3771663bf45f 100644 --- a/src/test/librbd/crypto/openssl/test_DataCryptor.cc +++ b/src/test/librbd/crypto/openssl/test_DataCryptor.cc @@ -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 -- 2.39.5