diff options
author | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2016-06-16 20:14:54 +0000 |
---|---|---|
committer | Jonathan Peyton <jonathan.l.peyton@intel.com> | 2016-06-16 20:14:54 +0000 |
commit | 72a8498e0881a5480c66d950ffa77cd44c3b65fa (patch) | |
tree | b567916fe387a8d278a03f4f7acf939802a89279 /openmp/runtime/src/kmp_affinity.cpp | |
parent | 4ba3b0cda9050053e327a067d06281df9ef6a5bf (diff) | |
download | bcm5719-llvm-72a8498e0881a5480c66d950ffa77cd44c3b65fa.tar.gz bcm5719-llvm-72a8498e0881a5480c66d950ffa77cd44c3b65fa.zip |
Fixed missing memory cleanup in __kmp_affinity_create_hwloc_map()
Cleanup: fixed missing memory cleanup in couple of corner cases. Fixes possible
memory leak in some corner cases
Patch by Andrey Churbanov
Differential Revision: http://reviews.llvm.org/D21355
llvm-svn: 272946
Diffstat (limited to 'openmp/runtime/src/kmp_affinity.cpp')
-rw-r--r-- | openmp/runtime/src/kmp_affinity.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/openmp/runtime/src/kmp_affinity.cpp b/openmp/runtime/src/kmp_affinity.cpp index b6e77a63f4f..6f4c7c1910b 100644 --- a/openmp/runtime/src/kmp_affinity.cpp +++ b/openmp/runtime/src/kmp_affinity.cpp @@ -414,6 +414,7 @@ __kmp_affinity_create_hwloc_map(AddrUnsPair **address2os, KMP_INFORM(Topology, "KMP_AFFINITY", nPackages, nCoresPerPkg, __kmp_nThreadsPerCore, __kmp_ncores); } + KMP_CPU_FREE(oldMask); return 0; } @@ -562,6 +563,7 @@ __kmp_affinity_create_hwloc_map(AddrUnsPair **address2os, } if (__kmp_affinity_type == affinity_none) { + __kmp_free(retval); KMP_CPU_FREE(oldMask); return 0; } |