Re: Memory leak fix in psql

From: Andres Freund <andres(at)anarazel(dot)de>
To: Japin Li <japinli(at)hotmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, "tanghy(dot)fnst(at)fujitsu(dot)com" <tanghy(dot)fnst(at)fujitsu(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>, "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Memory leak fix in psql
Date: 2022-07-19 16:28:14
Message-ID: 20220719162814.ipbkzxzba3i7ylpo@awork3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2022-07-19 21:08:53 +0800, Japin Li wrote:
> From b2bcc3a1bac67b8b414f2025607f8dd35e096289 Mon Sep 17 00:00:00 2001
> From: Japin Li <japinli(at)hotmail(dot)com>
> Date: Tue, 19 Jul 2022 18:27:25 +0800
> Subject: [PATCH v2 1/1] Fix the memory leak in psql describe
>
> ---
> src/bin/psql/describe.c | 168 ++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 168 insertions(+)
>
> diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c
> index 0ce38e4b4c..7a070a6cd0 100644
> --- a/src/bin/psql/describe.c
> +++ b/src/bin/psql/describe.c
> @@ -112,7 +112,10 @@ describeAggregates(const char *pattern, bool verbose, bool showSystem)
> "n.nspname", "p.proname", NULL,
> "pg_catalog.pg_function_is_visible(p.oid)",
> NULL, 3))
> + {
> + termPQExpBuffer(&buf);
> return false;
> + }
>
> appendPQExpBufferStr(&buf, "ORDER BY 1, 2, 4;");

Adding copy over copy of this same block doesn't seem great. Can we instead
add a helper for it or such?

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2022-07-19 16:30:18 Re: [PATCH] Log details for client certificate failures
Previous Message Andres Freund 2022-07-19 16:14:32 Re: [PATCH] Log details for client certificate failures