Hi,
On Sat, Feb 19, 2022 at 04:04:38PM +0800, wliang@stu.xidian.edu.cn wrote:
> However, there are also some potential leaks caused by convertTSFunction()
> rather than getFormattedTypeName(). Besides, in convertTSFunction(), there
> are no any comment to say that the memory should not be freed by the caller.
Indeed this function doesn't cache anything and explicitly calls pg_strdup.
Here the amount of leaked memory is likely to be very small (I never heard of
people having thousands of text search templates or parsers), and pg_dump isn't
a long lived process so probably no one thought it was worth to extra code to
free that memory, which I agree with.