public inbox for [email protected]  
help / color / mirror / Atom feed
[PATCH] Fix missing pfree(flags.data) in overexplain_debug
2+ messages / 2 participants
[nested] [flat]

* [PATCH] Fix missing pfree(flags.data) in overexplain_debug
@ 2026-04-13 20:33  Lakshmi N <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Lakshmi N @ 2026-04-13 20:33 UTC (permalink / raw)
  To: [email protected]

Hi hackers,

attached a small patch to fix missing  pfree(flags.data) in
overexplain_debug.

Regards,
Lakshmi


Attachments:

  [application/octet-stream] 0001-Fix-missing-pfree-flags.data-in-overexplain_debug.patch (850B, 3-0001-Fix-missing-pfree-flags.data-in-overexplain_debug.patch)
  download | inline diff:
From 75d9ab6b6c5ed4fa21604766e28d84ec8a4b622e Mon Sep 17 00:00:00 2001
From: Lakshmi N <[email protected]>
Date: Mon, 13 Apr 2026 12:57:50 -0700
Subject: [PATCH] Fix missing pfree(flags.data) in overexplain_debug

---
 contrib/pg_overexplain/pg_overexplain.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/contrib/pg_overexplain/pg_overexplain.c b/contrib/pg_overexplain/pg_overexplain.c
index 715eda8dc56..d8fc1289cd5 100644
--- a/contrib/pg_overexplain/pg_overexplain.c
+++ b/contrib/pg_overexplain/pg_overexplain.c
@@ -405,6 +405,7 @@ overexplain_debug(PlannedStmt *plannedstmt, ExplainState *es)
 	if (flags.len == 0)
 		appendStringInfoString(&flags, ", none");
 	ExplainPropertyText("Flags", flags.data + 2, es);
+	pfree(flags.data);
 
 	/* Various lists of integers. */
 	overexplain_bitmapset("Subplans Needing Rewind",
-- 
2.43.0



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

* Re: [PATCH] Fix missing pfree(flags.data) in overexplain_debug
@ 2026-04-14 09:20  Heikki Linnakangas <[email protected]>
  parent: Lakshmi N <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Heikki Linnakangas @ 2026-04-14 09:20 UTC (permalink / raw)
  To: Lakshmi N <[email protected]>; [email protected]

On 13/04/2026 23:33, Lakshmi N wrote:
> Hi hackers,
> 
> attached a small patch to fix missing  pfree(flags.data) in 
> overexplain_debug.

These leaks are to a relatively short-lived memory context. We don't 
need to meticulously pfree() those, they will go away with the memory 
context. There are also numerous psprintf() calls in the function and in 
the subroutines which are not pfreed, for example.

We're not totally consistent, as there are pfree() calls in some of the 
subroutines. I don't know if there's some grand plan on when to pfree() 
and when not to bother, but this one pfree() won't move the needle much 
in any case.

- Heikki






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


end of thread, other threads:[~2026-04-14 09:20 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2026-04-13 20:33 [PATCH] Fix missing pfree(flags.data) in overexplain_debug Lakshmi N <[email protected]>
2026-04-14 09:20 ` Heikki Linnakangas <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox