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

Commit b6948e1

Browse files
committed
pg_restore: Fix memory and file descriptor leak with directory format
found by Coverity
1 parent 805f798 commit b6948e1

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
@@ -365,6 +365,9 @@ _PrintFileData(ArchiveHandle *AH, char *filename, RestoreOptions *ropt)
365365
ahwrite(buf, 1, cnt, AH);
366366

367367
free(buf);
368+
if (cfclose(cfp) != 0)
369+
die_horribly(AH, modulename, "could not close data file: %s\n",
370+
strerror(errno));
368371
}
369372

370373
/*

0 commit comments

Comments
 (0)