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
bd15b513
Commit
bd15b513
authored
Nov 19, 2013
by
nulltoken
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
index: Free the index on git_index_open() failure
parent
a5d73188
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletions
+7
-1
src/index.c
+7
-1
No files found.
src/index.c
View file @
bd15b513
...
...
@@ -321,6 +321,7 @@ void git_index__set_ignore_case(git_index *index, bool ignore_case)
int
git_index_open
(
git_index
**
index_out
,
const
char
*
index_path
)
{
git_index
*
index
;
int
error
;
assert
(
index_out
);
...
...
@@ -346,10 +347,15 @@ int git_index_open(git_index **index_out, const char *index_path)
index
->
entries_search_path
=
index_srch_path
;
index
->
reuc_search
=
reuc_srch
;
if
((
index_path
!=
NULL
)
&&
((
error
=
git_index_read
(
index
,
true
))
<
0
))
{
git_index_free
(
index
);
return
error
;
}
*
index_out
=
index
;
GIT_REFCOUNT_INC
(
index
);
return
(
index_path
!=
NULL
)
?
git_index_read
(
index
,
true
)
:
0
;
return
0
;
}
int
git_index_new
(
git_index
**
out
)
...
...
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