diff options
author | Alan Barr <a.barr@outlook.com> | 2018-10-13 19:10:12 +0100 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2018-10-30 16:55:55 -0300 |
commit | 4cb58460e571832e5f80f7259f64dd6268fab1eb (patch) | |
tree | 53e2bc3156eb158fd67e840a3954fea566b3489f | |
parent | c39f710b52e857c750d661ece97313a5aa26908c (diff) |
Prevent possible NULL pointer deference
Raised by cppcheck
-rw-r--r-- | darwin/DarwinProcessList.c | 3 |
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) { |