]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Avoid useless malloc/free traffic around getFormattedTypeName().
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 8 Sep 2021 19:09:42 +0000 (15:09 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 8 Sep 2021 19:09:42 +0000 (15:09 -0400)
commit52c300df323e8ebb3d0613baa4711179d9f342f3
tree88f8dc79b3ea4806efaccbeb89d181290b06fce1
parent67948a433e18a8561daf89dcc53e591a3fac659a
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.
src/bin/pg_dump/pg_dump.c