tools/power turbostat: Set per_cpu_msr_sum to NULL after free

Set per_cpu_msr_sum to NULL after freeing it in the error path
of msr_sum_record() to prevent potential use-after-free issues.

Signed-off-by: Emily Ehlert <ehemily@amazon.com>
Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
Emily Ehlert
2025-11-13 19:16:08 +00:00
committed by Len Brown
parent 28a3ad1fd2
commit 2313b97bc0

View File

@@ -6652,6 +6652,7 @@ void msr_sum_record(void)
timer_delete(timerid);
release_msr:
free(per_cpu_msr_sum);
per_cpu_msr_sum = NULL;
}
/*