From: Peter Eisentraut Date: Fri, 16 Mar 2012 17:53:31 +0000 (+0200) Subject: pg_restore: Fix memory and file descriptor leak with directory format X-Git-Tag: REL9_2_BETA1~269 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d8e5b3427a0f0c127eb08a3130055180ed0118e1;p=thirdparty%2Fpostgresql.git pg_restore: Fix memory and file descriptor leak with directory format found by Coverity --- diff --git a/src/bin/pg_dump/pg_backup_directory.c b/src/bin/pg_dump/pg_backup_directory.c index df95411cfd9..4b59516fe46 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)); } /*