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 6d4607e886
commit b128e75ecc

View File

@@ -2154,6 +2154,7 @@ CheckTablespaceDirectory(void)
PG_TBLSPC_DIR),
errhint("Remove those directories, or set \"allow_in_place_tablespaces\" to ON transiently to let recovery complete.")));
}
FreeDir(dir);
}
/*