postgres.git / summary / log / commit / refs
commit cde0f9c6a2a54f965b2405ad06e857b2cbbe47de
Author: Fujii Masao <fujii@postgresql.org>
Date: Wed Oct 14 02:12:39 2026 +0000
First released in: 14.25, 15.20, 16.16, 17.12, 18.7, 19.0
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@highgo.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/66A784B7-55C1-4613-8C24-B4C2A8D75414@gmail.com
Backpatch-through: 14
src/backend/access/transam/xlog.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c
index bb84525e665..a835f77b734 100644
--- a/src/backend/access/transam/xlog.c
+++ b/src/backend/access/transam/xlog.c
@@ -8333,6 +8333,7 @@ CheckTablespaceDirectory(void)
errdetail("All directory entries in pg_tblspc/ should be symbolic links."),
errhint("Remove those directories, or set allow_in_place_tablespaces to ON transiently to let recovery complete.")));
}
+ FreeDir(dir);
}
/*
[parent: 205f40f5b273]