[Openmp-commits] [PATCH] D96892: [OpenMP] libomp: cleanup some resource leaks

Andrey Churbanov via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Sat Feb 20 12:28:16 PST 2021


This revision was automatically updated to reflect the committed changes.
Closed by commit rG1611e5473c5e: [OpenMP] libomp: cleanup some resource leaks (authored by AndreyChurbanov).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D96892/new/

https://reviews.llvm.org/D96892

Files:
  openmp/runtime/src/z_Linux_util.cpp


Index: openmp/runtime/src/z_Linux_util.cpp
===================================================================
--- openmp/runtime/src/z_Linux_util.cpp
+++ openmp/runtime/src/z_Linux_util.cpp
@@ -1909,10 +1909,14 @@
   KMP_CHECK_SYSFAIL("pthread_mutexattr_init", status);
   status = pthread_mutex_init(&__kmp_wait_mx.m_mutex, &mutex_attr);
   KMP_CHECK_SYSFAIL("pthread_mutex_init", status);
+  status = pthread_mutexattr_destroy(&mutex_attr);
+  KMP_CHECK_SYSFAIL("pthread_mutexattr_destroy", status);
   status = pthread_condattr_init(&cond_attr);
   KMP_CHECK_SYSFAIL("pthread_condattr_init", status);
   status = pthread_cond_init(&__kmp_wait_cv.c_cond, &cond_attr);
   KMP_CHECK_SYSFAIL("pthread_cond_init", status);
+  status = pthread_condattr_destroy(&cond_attr);
+  KMP_CHECK_SYSFAIL("pthread_condattr_destroy", status);
 #if USE_ITT_BUILD
   __kmp_itt_initialize();
 #endif /* USE_ITT_BUILD */


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D96892.325230.patch
Type: text/x-patch
Size: 904 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20210220/02dff0c8/attachment.bin>


More information about the Openmp-commits mailing list