mirror of
https://github.com/postgres/postgres.git
synced 2026-05-28 04:35:45 -04: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
c3c8b63d76
commit
4abf63c62b
1 changed files with 5 additions and 0 deletions
|
|
@ -375,6 +375,8 @@ make_icu_collator(const char *iculocstr, const char *icurules)
|
|||
iculocstr, icurules, u_errorName(status))));
|
||||
}
|
||||
|
||||
pfree(my_rules);
|
||||
pfree(all_rules);
|
||||
return collator_all_rules;
|
||||
}
|
||||
}
|
||||
|
|
@ -831,6 +833,9 @@ strnxfrm_prefix_icu(char *dest, size_t destsize,
|
|||
(errmsg("sort key generation failed: %s",
|
||||
u_errorName(status))));
|
||||
|
||||
if (buf != sbuf)
|
||||
pfree(buf);
|
||||
|
||||
return result_bsize;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue