Fix resource leak (src/bin/pg_combinebackup/pg_combinebackup.c)

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Fix resource leak (src/bin/pg_combinebackup/pg_combinebackup.c)
Date: 2023-12-30 13:34:12
Message-ID: CAEudQAqJo58d2_oydHu-SWgrR_YPGPtV9FBxmhwd4XSmkwkOQA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Per Coverity.

The function scan_for_existing_tablespaces in
(src/bin/pg_combinebackup/pg_combinebackup.c)
Has a resource leak.

The function opendir opendir
<https://pubs.opengroup.org/onlinepubs/009604599/functions/opendir.html>
Must be freed with closedir
<https://pubs.opengroup.org/onlinepubs/009604599/functions/closedir.html>

The commit affected is dc21234
<http://dc212340058b4e7ecfc5a7a81ec50e7a207bf288>

Trivial patch attached.

Best regards,
Ranier Vilela

Attachment Content-Type Size
fix-resource-leak-pg_combinebackup.patch application/octet-stream 404 bytes

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Ranier Vilela 2023-12-30 13:40:11 Re: Windows sockets (select missing events?)
Previous Message Jelte Fennema-Nio 2023-12-30 12:38:00 Re: Fix copy and paste error (src/bin/pg_basebackup/pg_basebackup.c)