Skip to content

Commit

Permalink
fix(semaphore): page fault on destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
CarlWachter authored and mkroening committed Jun 4, 2024
1 parent 1730051 commit 60a1bb9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/syscalls/semaphore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub unsafe extern "C" fn sys_sem_destroy(sem: *mut sem_t) -> i32 {
// Consume the pointer to the raw memory into a Box again
// and drop the Box to free the associated memory.
unsafe {
drop(Box::from_raw(sem));
drop(Box::from_raw((*sem).cast_mut()));
}
0
}
Expand Down

0 comments on commit 60a1bb9

Please sign in to comment.