pgsql: Avoid double-free in vacuumlo error path.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Avoid double-free in vacuumlo error path.
Дата
Msg-id E1h88Yt-0001r7-MH@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Avoid double-free in vacuumlo error path.

The code would do "PQclear(res)" twice if lo_unlink failed, evidently
due to careless thinking about how far out a "break" would break.
Remove the extra PQclear and adjust the loop logic so that we'll fall
out of both levels of loop after an error, as was clearly the intent.

Spotted by Coverity.  I have no idea why it took this long to notice,
since the bug has been there since commit 67ccbb080.  Accordingly,
back-patch to all supported branches.

Branch
------
REL9_5_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/171baf18325e30997123e9d5cf3e1a81e3a3f484

Modified Files
--------------
contrib/vacuumlo/vacuumlo.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: pgsql: Make heap TID a tiebreaker nbtree index column.
Следующее
От: Peter Geoghegan
Дата:
Сообщение: pgsql: Remove dead code from nbtsplitloc.c.