Re: psql memory leaks

2023-02-21 Thread Michael Paquier
On Tue, Feb 21, 2023 at 02:03:43PM -0500, Corey Huinker wrote: > Good catch. Patch passes make check-world. Indeed. I was reviewing the whole and there could be a point in resetting bind_nparams at the end of SendQuery() to keep a correct track of what's saved in the pset data for the bind

Re: psql memory leaks

2023-02-21 Thread Corey Huinker
On Mon, Feb 20, 2023 at 9:56 PM Kyotaro Horiguchi wrote: > I noticed that \bind is leaking memory for each option. > > =# SELECT $1, $2, $3 \ bind 1 2 3 \g > > The leaked memory blocks are comming from > psql_scan_slash_option(). The attached small patch resolves that > issue. I looked through

psql memory leaks

2023-02-20 Thread Kyotaro Horiguchi
I noticed that \bind is leaking memory for each option. =# SELECT $1, $2, $3 \ bind 1 2 3 \g The leaked memory blocks are comming from psql_scan_slash_option(). The attached small patch resolves that issue. I looked through the function's call sites, but I didn't find the same mistake.