Avoid resource leak (contrib/postgres_fdw/connection.c) - Mailing list pgsql-hackers

From Ranier Vilela
Subject Avoid resource leak (contrib/postgres_fdw/connection.c)
Date
Msg-id CAEudQAprLegxufoi93JuFVkCDmjT5wtGhu3gxT-E1Fg+1DGrag@mail.gmail.com
Whole thread Raw
Responses Re: Avoid resource leak (contrib/postgres_fdw/connection.c)
Re: Avoid resource leak (contrib/postgres_fdw/connection.c)
List pgsql-hackers
Hi.

Per Coverity.

CID 1645716: (#1 of 1): Resource leak (RESOURCE_LEAK)
8. leaked_storage: Variable str going out of scope leaks the storage str.data points to.

The function *postgres_fdw_connection* leaks the contents of
var str.data
Once that function *cstring_to_text* palloc the contents
must be necessary to free the var str.data.

patch attached.

best regards,
Ranier Vilelas
Attachment

pgsql-hackers by date:

Previous
From: shveta malik
Date:
Subject: Re: synchronized_standby_slots behavior inconsistent with quorum-based synchronous replication
Next
From: Amit Kapila
Date:
Subject: Re: Report bytes and transactions actually sent downtream