Skip to content

fileops: fix leaking fd in mmap_ro_file#4201

Merged
ethomson merged 1 commit into
libgit2:masterfrom
pks-t:pks/fileops-fd-leak
Apr 12, 2017
Merged

fileops: fix leaking fd in mmap_ro_file#4201
ethomson merged 1 commit into
libgit2:masterfrom
pks-t:pks/fileops-fd-leak

Conversation

@pks-t

@pks-t pks-t commented Apr 12, 2017

Copy link
Copy Markdown
Member

When the git_futils_mmap_ro_file function encounters an error after
the file has been opened, it will do a simple returns. Instead, we
should close the opened file descriptor to avoid a leak. This commit
fixes the issue.

When the `git_futils_mmap_ro_file` function encounters an error after
the file has been opened, it will do a simple returns. Instead, we
should close the opened file descriptor to avoid a leak. This commit
fixes the issue.
@ethomson ethomson merged commit f9d3b0d into libgit2:master Apr 12, 2017
@pks-t pks-t deleted the pks/fileops-fd-leak branch April 28, 2017 11:07
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.

2 participants