aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPeter Eisentraut <peter_e@gmx.net>2012-03-16 19:53:31 +0200
committerPeter Eisentraut <peter_e@gmx.net>2012-03-16 19:57:45 +0200
commitb6948e15464d7e86c0d892619d9c90c9cfd124f1 (patch)
treeb6b012e03d0098696a4082ee3ad7b8b14297784d /src
parent805f798e0ef0030b0f475a7a56322c51b5ef38b3 (diff)
downloadpostgresql-b6948e15464d7e86c0d892619d9c90c9cfd124f1.tar.gz
postgresql-b6948e15464d7e86c0d892619d9c90c9cfd124f1.zip
pg_restore: Fix memory and file descriptor leak with directory format
found by Coverity
Diffstat (limited to 'src')
-rw-r--r--src/bin/pg_dump/pg_backup_directory.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/bin/pg_dump/pg_backup_directory.c b/src/bin/pg_dump/pg_backup_directory.c
index 111c3e822a8..3936479cdaf 100644
--- a/src/bin/pg_dump/pg_backup_directory.c
+++ b/src/bin/pg_dump/pg_backup_directory.c
@@ -365,6 +365,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));
}
/*