1
0
mirror of https://github.com/postgres/postgres.git synced 2026-10-23 13:29:09 +03:00

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
This commit is contained in:
Fujii Masao
2026-10-14 11:11:08 +09:00
parent a8c98c8843
commit c5e6dd7363

View File

@@ -2180,6 +2180,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);
}
/*