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
7d26c410
Commit
7d26c410
authored
Dec 09, 2012
by
Scott J. Goldman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix a bunch of leaks, error handling cases
parent
e51c8b99
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
12 deletions
+15
-12
src/graph.c
+15
-12
No files found.
src/graph.c
View file @
7d26c410
...
...
@@ -32,7 +32,6 @@ static int interesting(git_pqueue *list, git_commit_list *roots)
static
int
mark_parents
(
git_revwalk
*
walk
,
git_commit_list_node
*
one
,
git_commit_list_node
*
two
)
{
int
error
;
unsigned
int
i
;
git_commit_list
*
roots
=
NULL
;
git_pqueue
list
;
...
...
@@ -47,16 +46,16 @@ static int mark_parents(git_revwalk *walk, git_commit_list_node *one,
return
-
1
;
if
(
git_commit_list_parse
(
walk
,
one
)
<
0
)
return
-
1
;
goto
on_error
;
one
->
flags
|=
PARENT1
;
if
(
git_pqueue_insert
(
&
list
,
one
)
<
0
)
return
-
1
;
goto
on_error
;
if
(
git_commit_list_parse
(
walk
,
two
)
<
0
)
return
-
1
;
goto
on_error
;
two
->
flags
|=
PARENT2
;
if
(
git_pqueue_insert
(
&
list
,
two
)
<
0
)
return
-
1
;
goto
on_error
;
/* as long as there are non-STALE commits */
while
(
interesting
(
&
list
,
roots
))
{
...
...
@@ -80,25 +79,29 @@ static int mark_parents(git_revwalk *walk, git_commit_list_node *one,
if
((
p
->
flags
&
flags
)
==
flags
)
continue
;
if
(
(
error
=
git_commit_list_parse
(
walk
,
p
)
)
<
0
)
return
error
;
if
(
git_commit_list_parse
(
walk
,
p
)
<
0
)
goto
on_
error
;
p
->
flags
|=
flags
;
if
(
git_pqueue_insert
(
&
list
,
p
)
<
0
)
return
-
1
;
goto
on_error
;
}
/* Keep track of root commits, to make sure the path gets marked */
if
(
commit
->
out_degree
==
0
)
{
if
(
git_commit_list_insert
(
commit
,
&
roots
)
==
NULL
)
return
-
1
;
goto
on_error
;
}
}
if
(
roots
)
git_commit_list_free
(
&
roots
);
git_commit_list_free
(
&
roots
);
git_pqueue_free
(
&
list
);
return
0
;
on_error:
git_commit_list_free
(
&
roots
);
git_pqueue_free
(
&
list
);
return
-
1
;
}
...
...
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