From f26d153612030c840b2e76bf60707dd86591385e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Villemain?= Date: Wed, 26 Mar 2025 09:25:21 +0100 Subject: [PATCH] Add missing pfree during acl propagation When assigning acl from datum, it's possible that we have a detoasted copy. In such situation, we ought to pfree() it, here during TABLE GRANTS propagation. It's not directly related with the PR, but a discovery while being here. --- src/backend/distributed/deparser/citus_ruleutils.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/backend/distributed/deparser/citus_ruleutils.c b/src/backend/distributed/deparser/citus_ruleutils.c index bdba2bf6e..c999ae8da 100644 --- a/src/backend/distributed/deparser/citus_ruleutils.c +++ b/src/backend/distributed/deparser/citus_ruleutils.c @@ -1230,6 +1230,10 @@ pg_get_table_grants(Oid relationId) resetStringInfo(&buffer); } } + + /* if we have a detoasted copy, free it */ + if ((Pointer) acl != DatumGetPointer(aclDatum)) + pfree(acl); } resetStringInfo(&buffer);