Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d8e5b34

Browse files
committed
pg_restore: Fix memory and file descriptor leak with directory format
found by Coverity
1 parent 693ff85 commit d8e5b34

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/bin/pg_dump/pg_backup_directory.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,9 @@ _PrintFileData(ArchiveHandle *AH, char *filename, RestoreOptions *ropt)
356356
ahwrite(buf, 1, cnt, AH);
357357

358358
free(buf);
359+
if (cfclose(cfp) != 0)
360+
die_horribly(AH, modulename, "could not close data file: %s\n",
361+
strerror(errno));
359362
}
360363

361364
/*

0 commit comments

Comments
 (0)