summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrey Churbanov <Andrey.Churbanov@intel.com>2017-07-18 08:30:03 +0000
committerAndrey Churbanov <Andrey.Churbanov@intel.com>2017-07-18 08:30:03 +0000
commitddc38722a4cea89d908d38eb441b5ea4ec995055 (patch)
treec92cc0e94e4915a4744a1b0e0cab2ea232059dc7
parent3a9968184a09e6eb827efae256c957744d33be6f (diff)
downloadbcm5719-llvm-ddc38722a4cea89d908d38eb441b5ea4ec995055.tar.gz
bcm5719-llvm-ddc38722a4cea89d908d38eb441b5ea4ec995055.zip
OpenMP RTL cleanup: nullify pointer after memory freeing
Differential Revision: https://reviews.llvm.org/D35497 llvm-svn: 308274
-rw-r--r--openmp/runtime/src/kmp_affinity.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/openmp/runtime/src/kmp_affinity.h b/openmp/runtime/src/kmp_affinity.h
index d17717f4e3a..67045733f5b 100644
--- a/openmp/runtime/src/kmp_affinity.h
+++ b/openmp/runtime/src/kmp_affinity.h
@@ -688,8 +688,11 @@ public:
: maxLevels(7), depth(1), uninitialized(not_initialized), resizing(0) {}
void fini() {
- if (!uninitialized && numPerLevel)
+ if (!uninitialized && numPerLevel) {
__kmp_free(numPerLevel);
+ numPerLevel = NULL;
+ uninitialized = not_initialized;
+ }
}
void init(AddrUnsPair *adr2os, int num_addrs) {
OpenPOWER on IntegriCloud