Avoid resource leak (src/bin/pg_dump/pg_dumpall.c)

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Avoid resource leak (src/bin/pg_dump/pg_dumpall.c)
Date: 2026-03-08 23:05:06
Message-ID: CAEudQAq2wyXZRdsh+wVHcOrungPU+_aQeQU12wbcgrmE0bQovA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi.

Per Coverity.

Coverity complains about one resource leak in the function
*drops_DBs*.

CID 1645454: (#1 of 1): Resource leak (RESOURCE_LEAK)
19. leaked_storage: Variable delQry going out of scope leaks the storage it
points to.

Fix by avoiding creating the buffer unnecessarily.

Trivial patch attached.

best regards,
Ranier Vilela

Attachment Content-Type Size
avoid-resource-leak-pg_dumpall.patch application/octet-stream 705 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mihail Nikalayeu 2026-03-09 00:03:00 Re: Resetting snapshots during the first phase of [CREATE |RE]INDEX CONCURRENTLY
Previous Message Daniel Gustafsson 2026-03-08 22:11:57 Re: [PATCH] Remove unused is_error parameter from TeardownHistoricSnapshot()