Fix exits which may cause double-free corruption (#1086)

This commit is contained in:
Addison Crump 2023-02-20 23:34:16 +01:00 committed by GitHub
parent 20958a979f
commit b7296db406
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -87,7 +87,7 @@ pub unsafe fn shutdown_handler<SP>(
std::ptr::drop_in_place(sr);
}
log::info!("Bye!");
std::process::exit(0);
libc::_exit(0);
}
#[cfg(all(unix, feature = "std"))]

View File

@ -1536,7 +1536,7 @@ where
.post_exec_child_all(state, input, &ExitKind::Ok)
.expect("Failed to run post_exec on observers");
std::process::exit(0);
libc::_exit(0);
Ok(ExitKind::Ok)
}
@ -1613,7 +1613,7 @@ where
.post_exec_child_all(state, input, &ExitKind::Ok)
.expect("Failed to run post_exec on observers");
std::process::exit(0);
libc::_exit(0);
Ok(ExitKind::Ok)
}