On 06/04/2026 14:55, Aleksander Alekseev wrote:
>> Introduce a new mechanism for registering shared memory areas
>>
>> [...]
>
> This commit introduced a memory leak which Valgrind is very much upset about.
>
> ShmemRequestStructWithOpts() allocates a copy of `options` in
> TopMemoryContext and passes it to ShmemRequestInternal(). It appends
> it to pending_shmem_requests as request->options. Later in
> ShmemInitRequested() when the list is freed `->options` leak. There
> are similar issues in ShmemAttachRequested() and
> CallShmemCallbacksAfterStartup() which free pending_shmem_requests
> without freeing `->options`.
>
> I propose to fix it as attached.
LGTM, I will push this shortly. Thanks!
- Heikki