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
b2dd6815
Commit
b2dd6815
authored
Jul 18, 2011
by
Kirill A. Shutemov
Committed by
Vicent Marti
Jul 25, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
index: introduce index_entry_free()
Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
parent
51917d9c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
src/index.c
+10
-4
No files found.
src/index.c
View file @
b2dd6815
...
...
@@ -349,6 +349,14 @@ static git_index_entry *index_entry_dup(const git_index_entry *source_entry)
return
entry
;
}
static
void
index_entry_free
(
git_index_entry
*
entry
)
{
if
(
!
entry
)
return
;
free
(
entry
->
path
);
free
(
entry
);
}
static
int
index_insert
(
git_index
*
index
,
const
git_index_entry
*
source_entry
,
int
replace
)
{
git_index_entry
*
entry
;
...
...
@@ -402,15 +410,13 @@ static int index_insert(git_index *index, const git_index_entry *source_entry, i
/* exists, replace it */
entry_array
=
(
git_index_entry
**
)
index
->
entries
.
contents
;
free
(
entry_array
[
position
]
->
path
);
free
(
entry_array
[
position
]);
index_entry_free
(
entry_array
[
position
]);
entry_array
[
position
]
=
entry
;
return
GIT_SUCCESS
;
cleanup_oom:
free
(
entry
->
path
);
free
(
entry
);
index_entry_free
(
entry
);
return
GIT_ENOMEM
;;
}
...
...
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