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
21d73e71
Commit
21d73e71
authored
Mar 22, 2011
by
Vicent Marti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always free the parents of a revwalk commit
Thanks to Carlos Martín Nieto for spotting this.
parent
1881f078
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
src/revwalk.c
+11
-0
No files found.
src/revwalk.c
View file @
21d73e71
...
@@ -482,11 +482,22 @@ int git_revwalk_new(git_revwalk **revwalk_out, git_repository *repo)
...
@@ -482,11 +482,22 @@ int git_revwalk_new(git_revwalk **revwalk_out, git_repository *repo)
void
git_revwalk_free
(
git_revwalk
*
walk
)
void
git_revwalk_free
(
git_revwalk
*
walk
)
{
{
unsigned
int
i
;
unsigned
int
i
;
const
void
*
_unused
;
commit_object
*
commit
;
if
(
walk
==
NULL
)
if
(
walk
==
NULL
)
return
;
return
;
git_revwalk_reset
(
walk
);
git_revwalk_reset
(
walk
);
/* if the parent has more than PARENTS_PER_COMMIT parents,
* we had to allocate a separate array for those parents.
* make sure it's being free'd */
GIT_HASHTABLE_FOREACH
(
walk
->
commits
,
_unused
,
commit
,
{
if
(
commit
->
out_degree
>
PARENTS_PER_COMMIT
)
free
(
commit
->
parents
);
});
git_hashtable_free
(
walk
->
commits
);
git_hashtable_free
(
walk
->
commits
);
git_pqueue_free
(
&
walk
->
iterator_time
);
git_pqueue_free
(
&
walk
->
iterator_time
);
...
...
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