From: | "Euler Taveira" <euler(at)eulerto(dot)com> |
---|---|
To: | "ranier(dot)vf(at)gmail(dot)com" <ranier(dot)vf(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Fix some resources leaks (src/bin/pg_basebackup/pg_createsubscriber.c) |
Date: | 2024-03-28 02:07:44 |
Message-ID: | 7c1ec392-bd03-40aa-8a2a-81969af2f1cd@app.fastmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Wed, Mar 27, 2024, at 8:50 PM, Ranier Vilela wrote:
> Coverity has some reports in the new code
> pg_createsubscriber.c
> I think that Coverity is right.
It depends on your "right" definition. If your program execution is ephemeral
and the leak is just before exiting, do you think it's worth it?
> 1.
> CID 1542682: (#1 of 1): Resource leak (RESOURCE_LEAK)
> leaked_storage: Variable buf going out of scope leaks the storage it points to.
It will exit in the next instruction.
> 2.
> CID 1542704: (#1 of 1): Resource leak (RESOURCE_LEAK)
> leaked_storage: Variable conn going out of scope leaks the storage it points to.
The connect_database function whose exit_on_error is false is used in 2 routines:
* cleanup_objects_atexit: that's about to exit;
* drop_primary_replication_slot: that will execute a few routines before exiting.
> 3.
> CID 1542691: (#1 of 1): Resource leak (RESOURCE_LEAK)
> leaked_storage: Variable str going out of scope leaks the storage it points to.
It will exit in the next instruction.
Having said that, applying this patch is just a matter of style.
--
Euler Taveira
EDB https://www.enterprisedb.com/
From | Date | Subject | |
---|---|---|---|
Next Message | Richard Guo | 2024-03-28 02:27:10 | Re: Remove some redundant set_cheapest() calls |
Previous Message | Melanie Plageman | 2024-03-28 01:53:26 | Re: Combine Prune and Freeze records emitted by vacuum |