On Fri, Jan 21, 2022 at 12:13 AM Alvaro Herrera <
alvherre@alvh.no-ip.org> wrote:
>
> And while wondering about that, I stumbled upon
> GetRelationPublicationActions(), which has a very weird API that it
> always returns a palloc'ed block -- but without saying so. And
> therefore, its only caller leaks that memory. Maybe not critical, but
> it looks ugly. I mean, if we're always going to do a memcpy, why not
> use a caller-supplied stack-allocated memory? Sounds like it'd be
> simpler.
>
+1
This issue exists on HEAD (i.e. was not introduced by the row filtering patch) and was already discussed on another thread ([1]) on which I posted a patch to correct the issue along the same lines that you're suggesting.
[1]
https://postgr.es/m/CAJcOf-d0%3DvQx1Pzbf%2BLVarywejJFS5W%2BM6uR%2B2d0oeEJ2VQ%2BEw%40mail.gmail.com
Regards,
Greg Nancarrow
Fujitsu Australia