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

Commit 57ce9ac

Browse files
committed
Remove dead code in pg_dump.
Coverity quite reasonably complained that this check for fout==NULL occurred after we'd already dereferenced fout. However, the check is just dead code since there is no code path by which CreateArchive can return a null pointer. Errors such as can't-open-that-file are reported down inside CreateArchive, and control doesn't return. So let's silence the warning by removing the dead code, rather than continuing to pretend it does something. Coverity didn't complain about this before 5b5fea2, so back-patch to 9.5 like that patch.
1 parent 4189e3d commit 57ce9ac

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

src/bin/pg_dump/pg_dump.c

-3
Original file line numberDiff line numberDiff line change
@@ -617,9 +617,6 @@ main(int argc, char **argv)
617617
/* Register the cleanup hook */
618618
on_exit_close_archive(fout);
619619

620-
if (fout == NULL)
621-
exit_horribly(NULL, "could not open output file \"%s\" for writing\n", filename);
622-
623620
/* Let the archiver know how noisy to be */
624621
fout->verbose = g_verbose;
625622

0 commit comments

Comments
 (0)