postgres.git / summary / log / commit / refs
commit a4515c9b41bcf7ff6d9ea012938706bd73e3fd54
Author: Jeff Davis <jdavis@postgresql.org>
Date: Thu Jan 29 18:37:09 2026 +0000
First released in: 16.14, 17.10, 18.4
Fix memory leaks in pg_locale_icu.c.
The backport prior to 18 requires minor modification due to code
refactoring.
Discussion: https://postgr.es/m/e2b7a0a88aaadded7e2d19f42d5ab03c9e182ad8.camel@j-davis.com
Backpatch-through: 16
src/backend/utils/adt/pg_locale.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/src/backend/utils/adt/pg_locale.c b/src/backend/utils/adt/pg_locale.c
index b9e1ade862b..bee165cd6a1 100644
--- a/src/backend/utils/adt/pg_locale.c
+++ b/src/backend/utils/adt/pg_locale.c
@@ -1435,6 +1435,9 @@ make_icu_collator(const char *iculocstr,
ereport(ERROR,
(errmsg("could not open collator for locale \"%s\" with rules \"%s\": %s",
iculocstr, icurules, u_errorName(status))));
+
+ pfree(my_rules);
+ pfree(agg_rules);
}
/* We will leak this string if the caller errors later :-( */
@@ -2231,6 +2234,9 @@ pg_strnxfrm_prefix_icu_no_utf8(char *dest, const char *src, int32_t srclen,
(errmsg("sort key generation failed: %s",
u_errorName(status))));
+ if (buf != sbuf)
+ pfree(buf);
+
return result_bsize;
}
[parent: 99b0786e0747]