This commit fixes memory leaks introduced by the new librbd encryption feature
Signed-off-by: Or Ozeri <oro@il.ibm.com>
ceph_assert((block_size % data_cryptor->get_block_size()) == 0);
}
+template <typename T>
+BlockCrypto<T>::~BlockCrypto() {
+ if (m_data_cryptor != nullptr) {
+ delete m_data_cryptor;
+ m_data_cryptor = nullptr;
+ }
+}
+
template <typename T>
int BlockCrypto<T>::crypt(ceph::bufferlist* data, uint64_t image_offset,
CipherMode mode) {
}
BlockCrypto(CephContext* cct, DataCryptor<T>* data_cryptor,
uint64_t block_size, uint64_t data_offset);
+ ~BlockCrypto();
int encrypt(ceph::bufferlist* data, uint64_t image_offset) override;
int decrypt(ceph::bufferlist* data, uint64_t image_offset) override;
if (io::util::trigger_copyup(image_ctx, object_no, io_context, ctx)) {
return;
}
+ delete ctx;
object_exists = false;
} else if (r < 0) {
complete(r);