Skip to content

Commit 62c1aa7

Browse files
authored
fix(binary): avoid leaking in Pack::pack_into (#610)
1 parent 6b192e8 commit 62c1aa7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/binary.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ macro_rules! pack_impl {
149149
unsafe impl Pack for $t {
150150
fn pack_into(vec: Vec<Self>) -> *mut zend_string {
151151
let len = vec.len() * ($d as usize / 8);
152-
let ptr = Box::into_raw(vec.into_boxed_slice());
152+
let ptr = vec.as_ptr();
153153
unsafe { ext_php_rs_zend_string_init(ptr.cast(), len as _, false) }
154154
}
155155

0 commit comments

Comments
 (0)