From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Assitance needed for the resolution of memory leak
Date: Wed, 11 Oct 2023 19:05:20 -0500
Message-ID: <6316561b-8dc5-c870-83d5-1efc9217178e@gmail.com> (raw)
In-Reply-To: <CAM-5MT0RX8Szzo6JE7FEWWvrt6CzNszWBsJrmDOvmY5=0Wh-Og@mail.gmail.com>
References: <CAM-5MT368yobLg+tscP0c8-zBEjymL8_OS+1GvDX5wNNcebvmA@mail.gmail.com>
<f5471979-ee1b-4391-b324-fcc66cba7e06@aklaver.com>
<CAM-5MT1bTbO_sCUVXiXoTehUfrgYVc8UHmNANLU8+feczK=xew@mail.gmail.com>
<881280.1697056635@sss.pgh.pa.us>
<CAM-5MT0RX8Szzo6JE7FEWWvrt6CzNszWBsJrmDOvmY5=0Wh-Og@mail.gmail.com>
That's why you /attach/ files, not paste text.
On 10/11/23 16:19, Sasmit Utkarsh wrote:
> Thanks Tom, It did work, and yeah I do have indentation in my editor,
> there was some formatting issue due to the copy and paste of the code.
> :)
>
> Regards,
> Sasmit Utkarsh
> +91-7674022625
>
>
> On Thu, Oct 12, 2023 at 2:07 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> Sasmit Utkarsh <utkarshsasmit@gmail.com> writes:
> > Like for an ex: I have provided the test run for a file which has 4
> > duplicate entries in the input file and below is the leak reported.
> I have
> > followed
> > consistently using PQclear to free all PGresult objects.
>
> No you haven't: you've got two PQexec-something calls and
> only one PQclear. If control reaches here:
>
> > res = PQexec(conn, Command);
>
> that will overwrite your only pointer to the PQexecParams
> result, and you won't clear it.
>
> BTW, if this is what your code actually looks like in your editor,
> it's no wonder you can't follow its basic control flow. Indent
> according to the brace structure, and your life will get easier.
>
> regards, tom lane
>
--
Born in Arizona, moved to Babylonia.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: ronljohnsonjr@gmail.com
Subject: Re: Assitance needed for the resolution of memory leak
In-Reply-To: <6316561b-8dc5-c870-83d5-1efc9217178e@gmail.com>
References: <CAM-5MT368yobLg+tscP0c8-zBEjymL8_OS+1GvDX5wNNcebvmA@mail.gmail.com> <f5471979-ee1b-4391-b324-fcc66cba7e06@aklaver.com> <CAM-5MT1bTbO_sCUVXiXoTehUfrgYVc8UHmNANLU8+feczK=xew@mail.gmail.com> <881280.1697056635@sss.pgh.pa.us> <CAM-5MT0RX8Szzo6JE7FEWWvrt6CzNszWBsJrmDOvmY5=0Wh-Og@mail.gmail.com> <6316561b-8dc5-c870-83d5-1efc9217178e@gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox