[Openmp-commits] [PATCH] D21355: Fixed missing memory cleanup

Terry Wilmarth via Openmp-commits openmp-commits at lists.llvm.org
Tue Jun 14 14:59:35 PDT 2016


tlwilmar created this revision.
tlwilmar added a reviewer: jlpeyton.
tlwilmar added a subscriber: openmp-commits.
tlwilmar set the repository for this revision to rL LLVM.

Cleanup: fixed missing memory cleanup in couple of corner cases.  Fixes possible memory leak in some corner cases

Patch by Andrey Churbanov

Repository:
  rL LLVM

http://reviews.llvm.org/D21355

Files:
  runtime/src/kmp_affinity.cpp

Index: runtime/src/kmp_affinity.cpp
===================================================================
--- runtime/src/kmp_affinity.cpp
+++ runtime/src/kmp_affinity.cpp
@@ -414,6 +414,7 @@
             KMP_INFORM(Topology, "KMP_AFFINITY", nPackages, nCoresPerPkg,
               __kmp_nThreadsPerCore, __kmp_ncores);
         }
+        KMP_CPU_FREE(oldMask);
         return 0;
     }
 
@@ -562,6 +563,7 @@
     }
 
     if (__kmp_affinity_type == affinity_none) {
+        __kmp_free(retval);
         KMP_CPU_FREE(oldMask);
         return 0;
     }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D21355.60767.patch
Type: text/x-patch
Size: 554 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20160614/99d32c44/attachment.bin>


More information about the Openmp-commits mailing list