Re: Re all: Report some potential memory leak bugs in pg_dump.c

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: wliang(at)stu(dot)xidian(dot)edu(dot)cn
Cc: pgsql-bugs <pgsql-bugs(at)lists(dot)postgresql(dot)org>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, david(dot)g(dot)johnston(at)gmail(dot)com
Subject: Re: Re all: Report some potential memory leak bugs in pg_dump.c
Date: 2022-02-19 11:10:05
Message-ID: 20220219111005.57bfn4qshuqxzkzi@jrouhaud
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

On Sat, Feb 19, 2022 at 04:04:38PM +0800, wliang(at)stu(dot)xidian(dot)edu(dot)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.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message wliang 2022-02-19 12:29:59 Re: Re: Re all: Report some potential memory leak bugs in pg_dump.c
Previous Message wliang 2022-02-19 08:04:38 Re all: Report some potential memory leak bugs in pg_dump.c