Skip to content
Snippets Groups Projects
Unverified Commit c19b3a22 authored by bors[bot]'s avatar bors[bot] Committed by GitHub
Browse files

Merge #731


731: don't leak memory if the environment is empty r=stlankes a=stlankes



Co-authored-by: Stefan Lankes's avatarStefan Lankes <slankes@eonerc.rwth-aachen.de>
parents a3df8e44 384b4101
No related branches found
No related tags found
No related merge requests found
Pipeline #971606 passed
......@@ -288,6 +288,7 @@ impl CpuFrequency {
source: CpuFrequencySources::Invalid,
}
}
fn set_detected_cpu_frequency(
&mut self,
mhz: u16,
......
......@@ -41,7 +41,12 @@ pub trait SyscallInterface: Send + Sync {
let argc = argv.len() as i32;
let argv = argv.leak().as_ptr();
let envv = envv.leak().as_ptr();
// do we have more than a end marker? If not, return as null pointer
let envv = if envv.len() == 1 {
core::ptr::null::<*const u8>()
} else {
envv.leak().as_ptr()
};
(argc, argv, envv)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment