pgsql: Fix (some of) pltcl memory usage

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема pgsql: Fix (some of) pltcl memory usage
Дата
Msg-id E1ZHA8G-0006ZY-15@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix (some of) pltcl memory usage

As reported by Bill Parker, PL/Tcl did not validate some malloc() calls
against NULL return.  Fix by using palloc() in a new long-lived memory
context instead.  This allows us to simplify error handling too, by
simply deleting the memory context instead of doing retail frees.

There's still a lot that could be done to improve PL/Tcl's memory
handling ...

This is pretty ancient, so backpatch all the way back.

Author: Michael Paquier and Álvaro Herrera
Discussion: https://www.postgresql.org/message-id/CAFrbyQwyLDYXfBOhPfoBGqnvuZO_Y90YgqFM11T2jvnxjLFmqw@mail.gmail.com

Branch
------
REL9_0_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/4c11967e7348b79a27738a6f714d61325c660c5b

Modified Files
--------------
src/pl/tcl/pltcl.c |   27 ++++++++++++++++++---------
1 file changed, 18 insertions(+), 9 deletions(-)


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

Предыдущее
От: Alvaro Herrera
Дата:
Сообщение: pgsql: Improve BRIN documentation somewhat
Следующее
От: Alvaro Herrera
Дата:
Сообщение: pgsql: Fix (some of) pltcl memory usage