summaryrefslogtreecommitdiffstats
path: root/darwin/DarwinProcessList.c
diff options
context:
space:
mode:
authorAlan Barr <a.barr@outlook.com>2018-10-13 19:10:12 +0100
committerHisham Muhammad <hisham@gobolinux.org>2019-02-10 14:16:46 +0100
commit60e557868ac3dcc34e6c815e1896ec5291934a26 (patch)
tree53e2bc3156eb158fd67e840a3954fea566b3489f /darwin/DarwinProcessList.c
parent79c939eb8413847b287e5d0ec0e7630e571d3a20 (diff)
Prevent possible NULL pointer deference
Raised by cppcheck
Diffstat (limited to 'darwin/DarwinProcessList.c')
-rw-r--r--darwin/DarwinProcessList.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/darwin/DarwinProcessList.c b/darwin/DarwinProcessList.c
index 4a580acc..09884480 100644
--- a/darwin/DarwinProcessList.c
+++ b/darwin/DarwinProcessList.c
@@ -84,9 +84,8 @@ void ProcessList_freeCPULoadInfo(processor_cpu_load_info_t *p) {
if(0 != munmap(*p, vm_page_size)) {
CRT_fatalError("Unable to free old CPU load information\n");
}
+ *p = NULL;
}
-
- *p = NULL;
}
unsigned ProcessList_allocateCPULoadInfo(processor_cpu_load_info_t *p) {

© 2014-2024 Faster IT GmbH | imprint | privacy policy