From: Or Ozeri Date: Thu, 25 Nov 2021 13:10:14 +0000 (+0200) Subject: test/librbd: fix memory leak in TestCryptoOpensslDataCryptor X-Git-Tag: v17.1.0~358^2~10 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=09ae3bd03d465af46bfefc03909b91b238d1586f;p=ceph-ci.git 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 --- diff --git a/src/test/librbd/crypto/openssl/test_DataCryptor.cc b/src/test/librbd/crypto/openssl/test_DataCryptor.cc index 69e2b450778..d3771663bf4 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