pgsql: Don't leak malloc'd strings when a GUC setting is rejected.

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Don't leak malloc'd strings when a GUC setting is rejected.
Дата
Msg-id E1lN4nd-0001ob-LL@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Don't leak malloc'd strings when a GUC setting is rejected.

Because guc.c prefers to keep all its string values in malloc'd
not palloc'd storage, it has to be more careful than usual to
avoid leaks.  Error exits out of string GUC hook checks failed
to clear the proposed value string, and error exits out of
ProcessGUCArray() failed to clear the malloc'd results of
ParseLongOption().

Found via valgrind testing.
This problem is ancient, so back-patch to all supported branches.

Discussion: https://postgr.es/m/3816764.1616104288@sss.pgh.pa.us

Branch
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/26a3ae06d85c835c04642c08e304e11821587ad2

Modified Files
--------------
src/backend/utils/misc/guc.c | 71 +++++++++++++++++++++++++++++---------------
1 file changed, 47 insertions(+), 24 deletions(-)


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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: pgsql: Fix TAP test for remove_temp_files_after_crash
Следующее
От: Fujii Masao
Дата:
Сообщение: pgsql: Fix comments in postmaster.c.