Merge branch 'rs/commit-reach-leakfix'
Leakfix. * rs/commit-reach-leakfix: commit-reach: plug minor memory leak after using is_descendant_of()
This commit is contained in:
commit
fa2c57d562
@ -411,6 +411,7 @@ int ref_newer(const struct object_id *new_oid, const struct object_id *old_oid)
|
|||||||
struct object *o;
|
struct object *o;
|
||||||
struct commit *old_commit, *new_commit;
|
struct commit *old_commit, *new_commit;
|
||||||
struct commit_list *old_commit_list = NULL;
|
struct commit_list *old_commit_list = NULL;
|
||||||
|
int ret;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Both new_commit and old_commit must be commit-ish and new_commit is descendant of
|
* Both new_commit and old_commit must be commit-ish and new_commit is descendant of
|
||||||
@ -432,7 +433,9 @@ int ref_newer(const struct object_id *new_oid, const struct object_id *old_oid)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
commit_list_insert(old_commit, &old_commit_list);
|
commit_list_insert(old_commit, &old_commit_list);
|
||||||
return is_descendant_of(new_commit, old_commit_list);
|
ret = is_descendant_of(new_commit, old_commit_list);
|
||||||
|
free_commit_list(old_commit_list);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
Reference in New Issue
Block a user