From: Jeff Davis <jdavis@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Tighten up make_libc_collator() and make_icu_collator().
Date: Tue, 24 Sep 2024 19:11:23 +0000
Message-ID: <E1stAwU-000jKT-UM@gemulon.postgresql.org> (raw)
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
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/ceeaaed87aa39425f1f2c2409f927c76efb8de89
Modified Files
--------------
src/backend/utils/adt/pg_locale.c | 176 ++++++++++++++++++++++++--------------
src/include/utils/pg_locale.h | 4 -
2 files changed, 111 insertions(+), 69 deletions(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-committers@postgresql.org
Cc: jdavis@postgresql.org, pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Tighten up make_libc_collator() and make_icu_collator().
In-Reply-To: <E1stAwU-000jKT-UM@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox