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
This commit is contained in:
Jonathan Peyton 2016-06-16 20:14:54 +00:00
parent 4ba3b0cda9
commit 72a8498e08
1 changed files with 2 additions and 0 deletions

View File

@ -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;
}