Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
24b8ed2b
Commit
24b8ed2b
authored
Feb 09, 2016
by
Patrick Steinhardt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
attr_file: fix resource leak
parent
e2625457
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
src/attr_file.c
+3
-2
No files found.
src/attr_file.c
View file @
24b8ed2b
...
...
@@ -123,7 +123,7 @@ int git_attr_file__load(
break
;
}
case
GIT_ATTR_FILE__FROM_FILE
:
{
int
fd
;
int
fd
=
-
1
;
/* For open or read errors, pretend that we got ENOTFOUND. */
/* TODO: issue warning when warning API is available */
...
...
@@ -133,7 +133,8 @@ int git_attr_file__load(
(
fd
=
git_futils_open_ro
(
entry
->
fullpath
))
<
0
||
(
error
=
git_futils_readbuffer_fd
(
&
content
,
fd
,
(
size_t
)
st
.
st_size
))
<
0
)
nonexistent
=
true
;
else
if
(
fd
>=
0
)
p_close
(
fd
);
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment