tweaks: do not leak a file descriptor when fdopen() fails

This commit is contained in:
Benno Schulenberg
2020-02-02 11:08:59 +01:00
parent 74f4c37d5f
commit ee05daab92

View File

@@ -211,6 +211,7 @@ int write_lockfile(const char *lockfilename, const char *origfilename, bool modi
if (filestream == NULL) {
statusline(MILD, _("Error writing lock file %s: %s"),
lockfilename, strerror(errno));
close(fd);
goto free_the_data;
}