jsonbuilder: use Box::from_raw instead of transmute to free

I think this is a bad use of transmute, while the end result
is the same, Box::from_raw is more correct as we created this
pointer with Box::into_raw.
pull/5059/head
Jason Ish 6 years ago committed by Victor Julien
parent e5d4332ede
commit f184bcc10e

@ -554,7 +554,7 @@ pub extern "C" fn jb_clone(js: &mut JsonBuilder) -> *mut JsonBuilder {
#[no_mangle]
pub unsafe extern "C" fn jb_free(js: &mut JsonBuilder) {
let _: Box<JsonBuilder> = std::mem::transmute(js);
let _ = Box::from_raw(js);
}
#[no_mangle]

Loading…
Cancel
Save