diff --git a/src/bin/pg_dump/pg_backup_directory.c b/src/bin/pg_dump/pg_backup_directory.c index df95411cfd..4b59516fe4 100644 --- a/src/bin/pg_dump/pg_backup_directory.c +++ b/src/bin/pg_dump/pg_backup_directory.c @@ -356,6 +356,9 @@ _PrintFileData(ArchiveHandle *AH, char *filename, RestoreOptions *ropt) ahwrite(buf, 1, cnt, AH); free(buf); + if (cfclose(cfp) != 0) + die_horribly(AH, modulename, "could not close data file: %s\n", + strerror(errno)); } /*