pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Robustify tuplesort's free_sort_tuple function
Date: Tue, 13 Jul 2021 01:31:55 +0000
Message-ID: <E1m37H9-0006yH-DB@gemulon.postgresql.org> (raw)

Robustify tuplesort's free_sort_tuple function

41469253e went to the trouble of removing a theoretical bug from
free_sort_tuple by checking if the tuple was NULL before freeing it. Let's
make this a little more robust by also setting the tuple to NULL so that
should we be called again we won't end up doing a pfree on the already
pfree'd tuple. Per advice from Tom Lane.

Discussion: https://postgr.es/m/3188192.1626136953@sss.pgh.pa.us
Backpatch-through: 9.6, same as 41469253e

Branch
------
REL_10_STABLE

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

Modified Files
--------------
src/backend/utils/sort/tuplesort.c | 1 +
1 file changed, 1 insertion(+)



view thread (7+ messages)  latest in thread

Message-ID: <E1m37H9-0006yH-DB@gemulon.postgresql.org>
Permalink:  ../E1m37H9-0006yH-DB@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1m37H9-0006yH-DB@gemulon.postgresql.org

 · 

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: drowley@postgresql.org
  Subject: Re: pgsql: Robustify tuplesort's free_sort_tuple function
  In-Reply-To: <E1m37H9-0006yH-DB@gemulon.postgresql.org>
  References: <E1m37H9-0006yH-DB@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