pgsql: Fix pfree issue in presorted DISTINCT aggregate code

From: David Rowley <drowley(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fix pfree issue in presorted DISTINCT aggregate code
Date: 2023-02-13 10:39:09
Message-ID: E1pRWEm-000ulR-Ch@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix pfree issue in presorted DISTINCT aggregate code

The logic in this area was recently changed in 7da51590e, however, in that
commit, I neglected to consider that the conditions in which we should
pfree the old Datum needed to be updated after that change. This could
result in trying to pfree a NULL value, as was demonstrated by Alexander
Lakhin.

Reported-by: Alexander Lakhin
Discussion: https://postgr.es/m/4103db46-d888-6d1d-e88d-87c21ed99472@gmail.com

Branch
------
master

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

Modified Files
--------------
src/backend/executor/execExprInterp.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2023-02-13 10:53:01 pgsql: Add wait_for_replay_catchup wrapper to Cluster.pm
Previous Message Peter Eisentraut 2023-02-13 09:10:27 pgsql: Consolidate ItemPointer to Datum conversion functions