diff --git a/src/files.c b/src/files.c index 9ddff172..70c17b00 100644 --- a/src/files.c +++ b/src/files.c @@ -258,6 +258,7 @@ int write_lockfile(const char *lockfilename, const char *origfilename, bool modi if (wroteamt < lockdatalen) { statusline(MILD, _("Error writing lock file %s: %s"), lockfilename, ferror(filestream)); + fclose(filestream); goto free_the_data; }