impl Clone for OutPoint {
fn clone(&self) -> Self {
Self {
- inner: Box::into_raw(Box::new(unsafe { &*self.inner }.clone())),
+ inner: if self.inner.is_null() { std::ptr::null_mut() } else {
+ Box::into_raw(Box::new(unsafe { &*self.inner }.clone())) },
is_owned: true,
}
}
}
#[no_mangle]
pub extern "C" fn OutPoint_clone(orig: &OutPoint) -> OutPoint {
- OutPoint { inner: Box::into_raw(Box::new(unsafe { &*orig.inner }.clone())), is_owned: true }
+ orig.clone()
}
/// The referenced transaction's txid.
#[no_mangle]