manually cherry picking ef029f292c058d3465fcc203b32473ecaddfcd4f

master
Niko PLP 5 months ago
parent 87f6cc1ec0
commit c7ea1a744a
  1. 2
      src/transactions/transaction_db.rs

@ -300,8 +300,8 @@ impl<T: ThreadMode> TransactionDB<T> {
let mut cnt = 0;
let ptr = ffi::rocksdb_transactiondb_get_prepared_transactions(db, &mut cnt);
let mut vec = vec![std::ptr::null_mut(); cnt];
std::ptr::copy_nonoverlapping(ptr, vec.as_mut_ptr(), cnt);
if !ptr.is_null() {
std::ptr::copy_nonoverlapping(ptr, vec.as_mut_ptr(), cnt);
ffi::rocksdb_free(ptr as *mut c_void);
}
vec

Loading…
Cancel
Save