mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-08-11 15:33:13 +00:00
fix(integration_tests): fix double free
This commit is contained in:
parent
aa9f59648e
commit
62de1b3e8d
@ -1005,7 +1005,6 @@ fn test_wallet_ffi_transfer_public() -> Result<()> {
|
||||
assert!(is_included);
|
||||
|
||||
unsafe {
|
||||
wallet_ffi_free_transfer_result(&raw mut transfer_result);
|
||||
wallet_ffi_destroy(wallet_ffi_handle);
|
||||
}
|
||||
|
||||
|
||||
@ -157,6 +157,7 @@ impl Default for FfiAccountList {
|
||||
|
||||
/// Result of a transfer operation.
|
||||
#[repr(C)]
|
||||
#[derive(Debug)]
|
||||
pub struct FfiTransferResult {
|
||||
// TODO: Replace with HashType FFI representation
|
||||
/// Transaction hash (null-terminated string, or null on failure).
|
||||
@ -176,11 +177,11 @@ impl Default for FfiTransferResult {
|
||||
|
||||
impl FfiTransferResult {
|
||||
#[must_use]
|
||||
/// Casting valid results hash into bytes.
|
||||
/// Casting valid results hash into bytes. Effectively frees `FfiTransferResult`.
|
||||
///
|
||||
/// # Safety
|
||||
/// Field `tx_hash` must be a valid pointer into transaction hash.
|
||||
pub unsafe fn tx_hash_bytes(&self) -> FfiBytes32 {
|
||||
pub unsafe fn tx_hash_bytes(self) -> FfiBytes32 {
|
||||
let cstring = unsafe { CString::from_raw(self.tx_hash) };
|
||||
let rstring = cstring.into_string().expect("Must be a valid Rust string");
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user