Skip to content
Snippets Groups Projects
Commit f4060db1 authored by Andres Freund's avatar Andres Freund
Browse files

Fix inconsequential fd leak in the new mark_file_as_archived() function.

As every error in mark_file_as_archived() will lead to a failure of
pg_basebackup the FD leak couldn't ever lead to a real problem.  It
seems better to fix the leak anyway though, rather than silence
Coverity, as the usage of the function might get extended or copied at
some point in the future.

Pointed out by Coverity.

Backpatch to 9.2, like the relevant part of the previous patch.
parent f961ad47
No related branches found
No related tags found
No related merge requests found
...@@ -65,6 +65,9 @@ mark_file_as_archived(const char *basedir, const char *fname) ...@@ -65,6 +65,9 @@ mark_file_as_archived(const char *basedir, const char *fname)
{ {
fprintf(stderr, _("%s: could not fsync file \"%s\": %s\n"), fprintf(stderr, _("%s: could not fsync file \"%s\": %s\n"),
progname, tmppath, strerror(errno)); progname, tmppath, strerror(errno));
close(fd);
return false; return false;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment