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

Ranier Vilela <ranier.vf@gmail.com>

From: Ranier Vilela <ranier.vf@gmail.com>
To: Pg Hackers <pgsql-hackers@postgresql.org>
Date: 2026-03-08T23:05:06Z
Lists: pgsql-hackers

Attachments

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

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. pg_dumpall: simplify coding of dropDBs()