pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Peter Eisentraut <peter@eisentraut.org>
Cc: pgsql-committers@lists.postgresql.org
Subject: Re: pgsql: Remove unnecessary casts in free() and pfree()
Date: Sat, 27 Aug 2022 10:49:39 -0400
Message-ID: <2342337.1661611779@sss.pgh.pa.us> (raw)
In-Reply-To: <2295181.1661609717@sss.pgh.pa.us>
References: <E1oRZup-001ImD-Vl@gemulon.postgresql.org>
	<20220827112304.GL2342@telsasoft.com>
	<2295181.1661609717@sss.pgh.pa.us>

I wrote:
> Justin Pryzby <pryzby@telsasoft.com> writes:
>> This seems to be breaking cfbot's "warnings" test.

> Hmm, well, casting away const is certainly not within pfree's remit,
> so I'm glad we changed this.

Oh, I see: sepgsql's quote_object_name() is doing

	const char *temp;

	temp = quote_identifier(src1);
	appendStringInfoString(&result, temp);
	if (src1 != temp)
		pfree(temp);

evidently because whoever wrote this felt a compulsion to override
quote_identifier's judgment that possibly leaking the quoted identifier
wasn't worth worrying about.  I think we should just nuke this code
altogether and write

	appendStringInfoString(&result, quote_identifier(src1));

			regards, tom lane





view thread (4+ messages)

Message-ID: <2342337.1661611779@sss.pgh.pa.us>
Permalink:  ../2342337.1661611779@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2342337.1661611779@sss.pgh.pa.us

 · 

reply

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, pryzby@telsasoft.com, peter@eisentraut.org
  Subject: Re: pgsql: Remove unnecessary casts in free() and pfree()
  In-Reply-To: <2342337.1661611779@sss.pgh.pa.us>
  References: <E1oRZup-001ImD-Vl@gemulon.postgresql.org> <20220827112304.GL2342@telsasoft.com> <2295181.1661609717@sss.pgh.pa.us> <2342337.1661611779@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