Re: How to properly fix memory leak - Mailing list pgsql-general

From Igor Korot
Subject Re: How to properly fix memory leak
Date
Msg-id CA+FnnTy9B_CKP_PXBjZKADXaF03Nm=CcShBFCA7rjqkbcL7N6g@mail.gmail.com
Whole thread Raw
In response to Re: How to properly fix memory leak  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hi, Tom,

On Sat, Apr 26, 2025 at 4:34 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Igor Korot <ikorot01@gmail.com> writes:
>>>> auto temp1 = m_pimpl->m_myconv.from_bytes( PQgetvalue(
>>>>                                                       res, i, 1 ) );
>>>> m_tablespaces.push_back( temp1 );

I would imagine that from_bytes() is producing a malloc'd
string.  Which part of this is responsible for seeing that
that gets freed?

No other places produces memory leak.
And I use this function quite extensively…

Thank you.



                        regards, tom lane

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: How to properly fix memory leak
Next
From: Igor Korot
Date:
Subject: How to get the data from the query