mirror of
https://github.com/postgres/postgres.git
synced 2026-03-03 05:40:43 -05:00
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
This commit is contained in:
parent
99b0786e07
commit
a4515c9b41
1 changed files with 6 additions and 0 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue