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
7a3f1de5
Commit
7a3f1de5
authored
Aug 22, 2016
by
Jason Haslam
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
filesystem_iterator: fixed double free on error
parent
c1b370e9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
5 deletions
+3
-5
src/iterator.c
+3
-5
No files found.
src/iterator.c
View file @
7a3f1de5
...
...
@@ -1834,6 +1834,9 @@ static int iterator_for_filesystem(
iter
=
git__calloc
(
1
,
sizeof
(
filesystem_iterator
));
GITERR_CHECK_ALLOC
(
iter
);
iter
->
base
.
type
=
type
;
iter
->
base
.
cb
=
&
callbacks
;
root_len
=
strlen
(
root
);
iter
->
root
=
git__malloc
(
root_len
+
2
);
...
...
@@ -1851,9 +1854,6 @@ static int iterator_for_filesystem(
if
((
error
=
git_buf_puts
(
&
iter
->
current_path
,
iter
->
root
))
<
0
)
goto
on_error
;
iter
->
base
.
type
=
type
;
iter
->
base
.
cb
=
&
callbacks
;
if
((
error
=
iterator_init_common
(
&
iter
->
base
,
repo
,
index
,
options
))
<
0
)
goto
on_error
;
...
...
@@ -1877,8 +1877,6 @@ static int iterator_for_filesystem(
return
0
;
on_error
:
git__free
(
iter
->
root
);
git_buf_free
(
&
iter
->
current_path
);
git_iterator_free
(
&
iter
->
base
);
return
error
;
}
...
...
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