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.
This change is OK, as the __kmp_str_free frees and nullifies parameter.