Skip to content

properly close file in error handling of saveConfig and saveBlob#385

Open
MichaelEischer wants to merge 1 commit into
masterfrom
fix-file-descriptor-leaks
Open

properly close file in error handling of saveConfig and saveBlob#385
MichaelEischer wants to merge 1 commit into
masterfrom
fix-file-descriptor-leaks

Conversation

@MichaelEischer
Copy link
Copy Markdown
Member

What does this PR change? What problem does it solve?

Fix two cases of file descriptor leaks:

  • A file descriptor was leaked if saveConfig failed to write a file.
  • A file descriptor and temp file was leaked if saveBlob exceeded the available quota.

Was the change previously discussed in an issue or on the forum?

Checked the code after #384 .

Checklist

  • I have added tests for all code changes.
  • [ ] I have added documentation for relevant changes (in the manual).
  • There's a new file in changelog/unreleased/ that describes the changes for our users (see template).
  • I'm done! This pull request is ready for review.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant