Avoid resource leak (src/bin/pg_dump/pg_dumpall.c) - Mailing list pgsql-hackers

From Ranier Vilela
Subject Avoid resource leak (src/bin/pg_dump/pg_dumpall.c)
Date
Msg-id CAEudQAq2wyXZRdsh+wVHcOrungPU+_aQeQU12wbcgrmE0bQovA@mail.gmail.com
Whole thread
Responses Re: Avoid resource leak (src/bin/pg_dump/pg_dumpall.c)
List 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

pgsql-hackers by date:

Previous
From: Daniel Gustafsson
Date:
Subject: Re: [PATCH] Remove unused is_error parameter from TeardownHistoricSnapshot()
Next
From: Mihail Nikalayeu
Date:
Subject: Re: Resetting snapshots during the first phase of [CREATE |RE]INDEX CONCURRENTLY