From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid useless malloc/free traffic around getFormattedTypeName().
Date: Wed, 08 Sep 2021 19:10:10 +0000
Message-ID: <E1mO2xW-0001d3-8V@gemulon.postgresql.org> (raw)
Avoid useless malloc/free traffic around getFormattedTypeName().
Coverity complained that one caller of getFormattedTypeName() failed
to free the returned string. Which is true, but rather than fixing
that one, let's get rid of this tedious and error-prone requirement.
Now that getFormattedTypeName() caches its result, strdup'ing that
result and expecting the caller to free it accomplishes little except
to waste cycles. We do create a leak in the case where getTypes didn't
make a TypeInfo for the type, but that basically shouldn't ever happen.
Back-patch, as commit 6c450a861 was. This isn't a particularly
interesting bug fix, but the API change seems like a hazard for
future back-patching activity if we don't back-patch it.
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/072e2f8a62002cb01ed6c4e161442e133509349e
Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 74 +++++++++++++++++++----------------------------
1 file changed, 29 insertions(+), 45 deletions(-)
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-committers@postgresql.org
Cc: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Avoid useless malloc/free traffic around getFormattedTypeName().
In-Reply-To: <E1mO2xW-0001d3-8V@gemulon.postgresql.org>
References: <E1mO2xW-0001d3-8V@gemulon.postgresql.org>
* 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