Re: [PATCH] Fix memory leak of primary_sysid in walreceiver

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [PATCH] Fix memory leak of primary_sysid in walreceiver
Дата
Msg-id ae6vp9L-GUb0ERTF@paquier.xyz
обсуждение
Ответ на [PATCH] Fix memory leak of primary_sysid in walreceiver  (DaeMyung Kang <charsyam@gmail.com>)
Список pgsql-hackers
On Mon, Apr 27, 2026 at 02:01:30AM +0900, DaeMyung Kang wrote:
> The attached patch adds a pfree(primary_sysid) right after the
> comparison.

My first impression was that it does not matter because I was under
the impression that this code path is only reached once, but that's
not the case: a WAL receiver could stay around waiting for
instructions before retrying a connection.

I doubt that this is worth bothering for in the back branches, as it
just means a small leak each time we switch to a new TLI repeatedly,
something that would matter mostly for a cascading standby where we
don't want to change the connection point (a SIGHUP'd primary_conninto
enforces a WAL receiver shutdown).  Let's clean up on HEAD, though.
--
Michael

Вложения

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