Fix various memory leaks in psql's describe commands \d*
authorMichael Paquier <[email protected]>
Thu, 21 Jul 2022 01:42:07 +0000 (10:42 +0900)
committerMichael Paquier <[email protected]>
Thu, 21 Jul 2022 01:42:07 +0000 (10:42 +0900)
commiteac3e00f8140e5a17b8021ba14e2239e3fd2a640
tree262d2c38a9bc1186e838acfc9ed887d40f10522d
parent2103266a360df688062c4188f1de074b957fd6e9
Fix various memory leaks in psql's describe commands \d*

Most of these have been introduced in d2d3547 with the new pattern
validation logic, and would leak memory worth an amount of one
PQExpBuffer each time (as of 256 bytes at minimum, possibly more).

Most of the patch has been written by Tang Haiying, with a few tweaks
coming from Álvaro Herrera.

Reported-by: Tang Haiying
Author: Tang Haiying, Álvaro Herrera
Reviewed-by: Mark Dilger, Andres Freund, Álvaro Herrera, Tom Lane, Japin
Li, Michael Paquier, Junwang Zhao
Backpatch-through: 15
src/bin/psql/describe.c