Tighten up make_libc_collator() and make_icu_collator().
Jeff Davis <jdavis@postgresql.org>
Tighten up make_libc_collator() and make_icu_collator(). Ensure that error paths within these functions do not leak a collator, and return the result rather than using an out parameter. (Error paths in the caller may still result in a leaked collator, which will be addressed separately.) In make_libc_collator(), if the first newlocale() succeeds and the second one fails, close the first locale_t object. The function make_icu_collator() doesn't have any external callers, so change it to be static. Discussion: https://postgr.es/m/54d20e812bd6c3e44c10eddcd757ec494ebf1803.camel@j-davis.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/utils/adt/pg_locale.c | modified | +111 −65 |
| src/include/utils/pg_locale.h | modified | +0 −4 |
Discussion
- [18] Fix a few issues with the collation cache 6 messages · 2024-08-08 → 2024-12-10