Replies: 1 comment 3 replies
-
So I did some digging. locale_t newlocale(int category_mask, const char* locale_name, locale_t /*base*/) {
// Are 'category_mask' and 'locale_name' valid?
if ((category_mask & ~LC_ALL_MASK) != 0 || locale_name == nullptr) {
errno = EINVAL;
return nullptr;
}
if (!__is_supported_locale(locale_name)) {
errno = ENOENT;
return nullptr;
}
return __alloc_locale(__is_utf8_locale(locale_name) ? 4 : 1);
} Taken from bionic master and turns out that it just ignores the base argument. So any program that tries to use newlocale as POSIX intended will leak memory. I'm bringing this up here since I don't know if json-c is the only package under termux that uses newlocale this way. Any thoughts? Sorry for the bump btw. Just trying to figure out what to do about this. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm pretty sure this is an issue in Android's libc but I'm surprised at how little information (including from google's git site) I've found about it.
json-c/json-c#668 and json-c/json-c#705 explain the problem and I can confirm any time I use
json_tokener_parse
or the test program they wrote, it leaks memory.I wasn't sure where to post this since I could just be missing something obvious but has anyone encountered this?
Beta Was this translation helpful? Give feedback.
All reactions