Commit ee78823
pg_upgrade: Fix inconsistency in memory freeing
The function in charge of freeing the memory from a result created by
PQescapeIdentifier() has to be PQfreemem(), to ensure that both
allocation and free come from libpq.
One spot in pg_upgrade was not respecting that for pg_database's
datlocale (daticulocale in v16) when the collation provider is libc (aka
datlocale/daticulocale is NULL) with an allocation done using
pg_strdup() and a free with PQfreemem(). The code is changed to always
use PQescapeLiteral() when processing the input.
Oversight in 9637bad. This commit is similar to 48e4ae9 and
5b94e27.
Author: Michael Paquier <michael@paquier.xyz>
Co-authored-by: Ranier Vilela <ranier.vf@gmail.com>
Discussion: https://postgr.es/m/Z601RQxTmIUohdkV@paquier.xyz
Backpatch-through: 161 parent f903d4d commit ee78823
1 file changed
+5
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
408 | 408 | | |
409 | 409 | | |
410 | 410 | | |
| 411 | + | |
411 | 412 | | |
412 | 413 | | |
413 | 414 | | |
| |||
421 | 422 | | |
422 | 423 | | |
423 | 424 | | |
424 | | - | |
425 | | - | |
426 | | - | |
427 | | - | |
428 | | - | |
429 | | - | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
430 | 429 | | |
431 | 430 | | |
432 | 431 | | |
| |||
0 commit comments