Skip to content

Commit

Permalink
Fix broken reallocarray implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
koute committed Nov 16, 2021
1 parent c0c7014 commit 7d34d88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion preload/src/api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ pub unsafe extern "C" fn realloc( old_ptr: *mut c_void, size: size_t ) -> *mut c
}

#[cfg_attr(not(test), no_mangle)]
pub unsafe extern "C" fn reallocarray( old_ptr: &mut c_void, count: size_t, element_size: size_t ) -> *mut c_void {
pub unsafe extern "C" fn reallocarray( old_ptr: *mut c_void, count: size_t, element_size: size_t ) -> *mut c_void {
let size = match (count as usize).checked_mul( element_size as usize ) {
None => {
*libc::__errno_location() = libc::ENOMEM;
Expand Down

0 comments on commit 7d34d88

Please sign in to comment.