From: Tom Lane <tgl@sss.pgh.pa.us>
To: Timo Sirainen <timo@sirainen.com>
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: libpq leaks memory for SSL connections
Date: Fri, 01 Oct 2021 15:46:39 -0400
Message-ID: <3632212.1633117599@sss.pgh.pa.us> (raw)
In-Reply-To: <CE981CB2-8907-4530-9886-24A54C9056B9@sirainen.com>
References: <CE981CB2-8907-4530-9886-24A54C9056B9@sirainen.com>
Timo Sirainen <timo@sirainen.com> writes:
> I noticed with valgrind how libpq is leaking memory:
> at 0x483577F: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so)
> by 0x5F645C8: CRYPTO_zalloc (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1)
> by 0x5E94EEF: BIO_meth_new (in /usr/lib/x86_64-linux-gnu/libcrypto.so.1.1)
> by 0x65181EB: ??? (in /usr/lib/x86_64-linux-gnu/libpq.so.5.11)
> by 0x651950C: ??? (in /usr/lib/x86_64-linux-gnu/libpq.so.5.11)
> by 0x650140F: PQconnectPoll (in /usr/lib/x86_64-linux-gnu/libpq.so.5.11)
I see no leak here. The struct is allocated once and kept for possible
re-use by future connections. valgrind concurs, saying it's "still
reachable".
regards, tom lane
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 using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, timo@sirainen.com, pgsql-bugs@lists.postgresql.org
Subject: Re: libpq leaks memory for SSL connections
In-Reply-To: <3632212.1633117599@sss.pgh.pa.us>
* 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