[Openmp-commits] [PATCH] D26786: Fix memory leaks of buffer allocated in __kmp_str_format()

Victor Campos via Openmp-commits openmp-commits at lists.llvm.org
Wed Nov 16 18:45:35 PST 2016


vhscampos created this revision.
vhscampos added reviewers: jcownie, AndreyChurbanov, jlpeyton.
vhscampos added a subscriber: openmp-commits.

Following comment in kmp_str.c line 480, strings allocated by __kmp_str_format() have to be freed using __kmp_str_free(). In many instances, these buffers were freed by calling free() directly.

In almost all calls to __kmp_msg(), KMP_ERR and KMP_SYSERRCODE are used to allocate messages. This allocation uses __kmp_str_format() as well, but the buffer is not freed afterwards. I made changes aiming to eliminate these leaks.


https://reviews.llvm.org/D26786

Files:
  runtime/src/kmp_affinity.cpp
  runtime/src/kmp_affinity.h
  runtime/src/kmp_environment.c
  runtime/src/kmp_i18n.c
  runtime/src/kmp_i18n.h
  runtime/src/kmp_itt.c
  runtime/src/kmp_runtime.c
  runtime/src/kmp_settings.c
  runtime/src/kmp_str.c
  runtime/src/z_Linux_util.c
  runtime/src/z_Windows_NT_util.c

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D26786.78303.patch
Type: text/x-patch
Size: 47680 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20161117/08bf920d/attachment-0001.bin>


More information about the Openmp-commits mailing list