diff options
author | Alan Barr <a.barr@outlook.com> | 2018-10-13 19:10:12 +0100 |
---|---|---|
committer | Hisham Muhammad <hisham@gobolinux.org> | 2019-02-10 14:16:46 +0100 |
commit | 60e557868ac3dcc34e6c815e1896ec5291934a26 (patch) | |
tree | 53e2bc3156eb158fd67e840a3954fea566b3489f | |
parent | 79c939eb8413847b287e5d0ec0e7630e571d3a20 (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) { |