Skip to content

Conversation

@jaisonZheng
Copy link
Contributor

macOS's newlocale() does not follow POSIX specification - it doesn't reuse the passed locale_t, causing ~1,472 bytes leak per json_tokener_parse() call.

This is the same issue as #668 (FreeBSD). The existing workaround works, but macOS was not auto-detected.

Tested with AddressSanitizer: leak drops from 1,472,000 bytes to ~120 bytes (system init only).

More information can be found in the issue

macOS's newlocale() does not follow POSIX specification - it doesn't
reuse the passed locale_t, causing ~1,472 bytes leak per json_tokener_parse() call.

This is the same issue as json-c#668 (FreeBSD). The existing workaround works,
but macOS was not auto-detected.

Tested with AddressSanitizer: leak drops from 1,472,000 bytes to ~120 bytes
(system init only).
@hawicz hawicz merged commit 46defb4 into json-c:master Jan 31, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants