pgsql: Add missing FreeDir() in CheckTablespaceDirectory()

From: Fujii Masao <fujii(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Add missing FreeDir() in CheckTablespaceDirectory()
Date: 2026-10-14 02:15:30
Message-ID: E1xGoWg-00000001Wib-1qxZ@gemulon.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add missing FreeDir() in CheckTablespaceDirectory()

CheckTablespaceDirectory() did not close the directory opened with
AllocateDir(), leaving its resources held during subsequent recovery,
potentially indefinitely on a standby. Add the missing FreeDir() call.

Backpatch to all supported versions.

Author: Chao Li <lic(at)highgo(dot)com>
Reviewed-by: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
Discussion: https://postgr.es/m/66A784B7-55C1-4613-8C24-B4C2A8D75414@gmail.com
Backpatch-through: 14

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/43eb4afde7a7fa36f9d002b603c9ed0ba26d9d8b

Modified Files
--------------
src/backend/access/transam/xlogrecovery.c | 1 +
1 file changed, 1 insertion(+)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2026-10-14 02:15:40 pgsql: Add missing FreeDir() in CheckTablespaceDirectory()
Previous Message Fujii Masao 2026-10-14 02:14:58 pgsql: Add missing FreeDir() in CheckTablespaceDirectory()