mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-25 16:51:16 +08:00
fix(load_mon): add return code at module stop path (#28544)
* fix uaf bug in load_mon module * fix(load_mon): end the perf cycle before deleting the module exit_and_cleanup() deletes this and frees _cycle_perf, so the elapsed counter has to be closed on the live object. Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com> --------- Signed-off-by: Jacob Dahl <dahl.jakejacob@gmail.com> Co-authored-by: Jacob Dahl <dahl.jakejacob@gmail.com>
This commit is contained in:
1 parent
f8387d19a1
commit
354823e2ef
1 file changed
+3
-2
@@ -111,15 +111,16 @@ void LoadMon::Run()
|
||||
|
||||
#endif
|
||||
|
||||
perf_end(_cycle_perf);
|
||||
|
||||
if (should_exit()) {
|
||||
ScheduleClear();
|
||||
#if defined (__PX4_LINUX)
|
||||
fclose(_proc_fd);
|
||||
#endif
|
||||
exit_and_cleanup(desc);
|
||||
return;
|
||||
}
|
||||
|
||||
perf_end(_cycle_perf);
|
||||
}
|
||||
|
||||
void LoadMon::cpuload()
|
||||
|
||||
Reference in new issue
Block a user