Re: Small memory fixes for pg_createsubcriber

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Small memory fixes for pg_createsubcriber
Date: 2025-02-13 11:16:47
Message-ID: CAEudQAptwXXkryqQ0VDY-4kmB_-8pb4b2xOn85SA6Dv4FP0Mdw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Em qua., 12 de fev. de 2025 às 18:17, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> escreveu:

> Ranier Vilela <ranier(dot)vf(at)gmail(dot)com> writes:
> > Coverity has some reports about pg_createsubcriber.
>
> > CID 1591322: (#1 of 1): Resource leak (RESOURCE_LEAK)
> > 10. leaked_storage: Variable dbname going out of scope leaks the storage
> it
> > points to.
>
> FTR, the security team's Coverity instance also complained about that.
> I was planning to fix it after the release freeze lifted, but you
> beat me to it, which is fine. Our report turned up a couple other
> things that I just pushed fixes for.
>
Yeah, I see the commits, thanks for that.
I still have some reports that I could post that Coverity thinks are bugs.
They are not, but I think it is worth the effort to fix them because the
code is confusing.
I think it would improve readability and future maintainability.

>
> (It seems like Coverity must've updated their rules recently,
> because we also got a bunch of false-positive reports that were
> not there before, mostly in pre-existing code.)
>
I believe they are trying to innovate at some point.
Many of these false positives come from a risky coding style,
I am much more cautious in my analyses.

best regards,
Ranier Vilela

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2025-02-13 11:25:25 Re: [PATCH] Optionally record Plan IDs to track plan changes for a query
Previous Message Vladlen Popolitov 2025-02-13 10:58:42 Re: Windows meson build