pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Avoid useless malloc/free traffic around getFormattedTypeName().
7+ messages / 1 participants
[nested] [flat]

* pgsql: Avoid useless malloc/free traffic around getFormattedTypeName().
@ 2021-09-08 19:10  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-09-08 19:10 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Avoid useless malloc/free traffic around getFormattedTypeName().
@ 2021-09-08 19:10  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-09-08 19:10 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_14_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/52c300df323e8ebb3d0613baa4711179d9f342f3

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 74 +++++++++++++++++++----------------------------
1 file changed, 29 insertions(+), 45 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Avoid useless malloc/free traffic around getFormattedTypeName().
@ 2021-09-08 19:10  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-09-08 19:10 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/da7d81dd0579a2579741bcfc816cf614c58d0aab

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 74 +++++++++++++++++++----------------------------
1 file changed, 29 insertions(+), 45 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Avoid useless malloc/free traffic around getFormattedTypeName().
@ 2021-09-08 19:10  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-09-08 19:10 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_12_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/df290e5f38fbef3920d28dd817bbb3ff5cc8ad9e

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 78 +++++++++++++++++++----------------------------
1 file changed, 31 insertions(+), 47 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Avoid useless malloc/free traffic around getFormattedTypeName().
@ 2021-09-08 19:10  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-09-08 19:10 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_11_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/4559c161cb5db350690c2b942fa6fecb3a3e79d3

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 78 +++++++++++++++++++----------------------------
1 file changed, 31 insertions(+), 47 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Avoid useless malloc/free traffic around getFormattedTypeName().
@ 2021-09-08 19:10  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-09-08 19:10 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_10_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/97b62cc480c8b9e0c14c5a94165ddcaad232f335

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 78 +++++++++++++++++++----------------------------
1 file changed, 31 insertions(+), 47 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread

* pgsql: Avoid useless malloc/free traffic around getFormattedTypeName().
@ 2021-09-08 19:10  Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 0 replies; 7+ messages in thread

From: Tom Lane @ 2021-09-08 19:10 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/dc47f05b553666f57e00f197f0e09962c535a297

Modified Files
--------------
src/bin/pg_dump/pg_dump.c | 78 +++++++++++++++++++----------------------------
1 file changed, 31 insertions(+), 47 deletions(-)



^ permalink  raw  reply  [nested|flat] 7+ messages in thread


end of thread, other threads:[~2021-09-08 19:10 UTC | newest]

Thread overview: 7+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2021-09-08 19:10 pgsql: Avoid useless malloc/free traffic around getFormattedTypeName(). Tom Lane <tgl@sss.pgh.pa.us>
2021-09-08 19:10 pgsql: Avoid useless malloc/free traffic around getFormattedTypeName(). Tom Lane <tgl@sss.pgh.pa.us>
2021-09-08 19:10 pgsql: Avoid useless malloc/free traffic around getFormattedTypeName(). Tom Lane <tgl@sss.pgh.pa.us>
2021-09-08 19:10 pgsql: Avoid useless malloc/free traffic around getFormattedTypeName(). Tom Lane <tgl@sss.pgh.pa.us>
2021-09-08 19:10 pgsql: Avoid useless malloc/free traffic around getFormattedTypeName(). Tom Lane <tgl@sss.pgh.pa.us>
2021-09-08 19:10 pgsql: Avoid useless malloc/free traffic around getFormattedTypeName(). Tom Lane <tgl@sss.pgh.pa.us>
2021-09-08 19:10 pgsql: Avoid useless malloc/free traffic around getFormattedTypeName(). Tom Lane <tgl@sss.pgh.pa.us>

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