postgres.git / summary / log / commit / refs

commit    c5e6dd73636dbb682852d95c55cb6bb0ad364ec5
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 d89af5356ad..16185ba1840 100644 --- a/src/backend/access/transam/xlogrecovery.c +++ b/src/backend/access/transam/xlogrecovery.c @@ -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); } /* [parent: a8c98c884367]