Re: Report a potential memory leak in describeOneTableDetails()

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Report a potential memory leak in describeOneTableDetails()
Дата
Msg-id 3052377.1644943008@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Report a potential memory leak in describeOneTableDetails()  (wliang@stu.xidian.edu.cn)
Список pgsql-bugs
wliang@stu.xidian.edu.cn writes:
> I find a potential memory leak in PostgresSQL 14.1, which is in the function describeOneTableDetails
(./src/bin/psql/describe.c).

Do you want to submit a patch?  The amount of memory involved here isn't
much, but since psql is a potentially long-running program, it seems worth
the trouble to be careful.

I think the best fix might be to drop these strdup's altogether, and
instead postpone freeing the PGresult to the end of the function, so
that we can just use the pointers returned by PQgetvalue.

            regards, tom lane



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Report a potential memory leak in setup_config()
Следующее
От: Masahiko Sawada
Дата:
Сообщение: Re: BUG #17385: "RESET transaction_isolation" inside serializable transaction causes Assert at the transaction end