]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
librbd/crypto: fix memory leak in when DataCryptor fails
authorOr Ozeri <oro@il.ibm.com>
Thu, 25 Nov 2021 13:08:47 +0000 (15:08 +0200)
committerIlya Dryomov <idryomov@gmail.com>
Sun, 13 Feb 2022 15:49:58 +0000 (16:49 +0100)
commite802c78eabd31ea1ed8f1264ab5e25aff93b45ee
tree28c7c2c958d27f3425b9ae3e471bcdc6da49bb2f
parent7bb011d91c8b3c157a0bb5d1d648549533f23eb1
librbd/crypto: fix memory leak in when DataCryptor fails

If DataCryptor fails, either in init_context or update_context,
the encryption context is not returned, which causes a memory leak.
This commit fixes this issue.

Signed-off-by: Or Ozeri <oro@il.ibm.com>
(cherry picked from commit 3af5bb7c61f37cdad56b13d1abccf5e9fd078563)
src/librbd/crypto/BlockCrypto.cc
src/test/librbd/crypto/test_mock_BlockCrypto.cc