postgres.git / summary / log / commit / refs

commit    43eb4afde7a7fa36f9d002b603c9ed0ba26d9d8b
Author:   Fujii Masao <fujii@postgresql.org>
Date:     Wed Oct 14 02:11:08 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/xlogrecovery.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/backend/access/transam/xlogrecovery.c b/src/backend/access/transam/xlogrecovery.c index 0838d2c686e..2bc615a691b 100644 --- a/src/backend/access/transam/xlogrecovery.c +++ b/src/backend/access/transam/xlogrecovery.c @@ -2130,6 +2130,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: 050ad7edbec6]