Fixes for a couple of resource leaks

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: PostgreSQL mailing lists <pgsql-hackers(at)postgresql(dot)org>
Subject: Fixes for a couple of resource leaks
Date: 2015-07-12 13:55:21
Message-ID: CAB7nPqQueXppg0CzSHPyF_5x9Nfii4dSCZtMsizPzc2xeB4qoA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi all,

Coverity is pointing out a couple of resource leaks:
- In DropReplicationSlot(at)streamutil(dot)c, query is leaked.
- In getTransforms(at)pg_dump(dot)c, the alloced result of get_language_name is
not free'd. Other code paths calling this routine do the job.
- In libpqGetCurrentXlogInsertLocation(at)libpq_fetch(dot)c (pg_rewind), the value
"val" returned by run_simple_query should be free'd. Other code paths do so.
- In libpqProcessFileList(at)libpq_fetch(dot)c, a call to PQclear is missing for a
query result.
- In vacuum_one_database(at)vacuumdb(dot)c, a call to PQclear is missing.
Attached is a patch to address all those things. Backpatches would be good
to have as well.
Regards,
--
Michael

Attachment Content-Type Size
20150712_memory_leaks.patch binary/octet-stream 1.9 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2015-07-12 16:02:07 TABLESAMPLE doesn't actually satisfy the SQL spec, does it?
Previous Message Michael Paquier 2015-07-12 13:15:00 Re: Re: Removing SSL renegotiation (Was: Should we back-patch SSL renegotiation fixes?)