Update auto-generated bindings
[rust-lightning] / lightning-c-bindings / src / chain / transaction.rs
index d66709010e82b00878ea4d545f48dd354a99c2d7..cb719789b5e659051df7b4d139d1f2c88a92daba 100644 (file)
@@ -48,7 +48,8 @@ impl OutPoint {
 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,
                }
        }
@@ -60,7 +61,7 @@ pub(crate) extern "C" fn OutPoint_clone_void(this_ptr: *const c_void) -> *mut c_
 }
 #[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]