Merge branch 'ab/plug-leak-in-revisions'
Plug the memory leaks from the trickiest API of all, the revision walker. * ab/plug-leak-in-revisions: (27 commits) revisions API: add a TODO for diff_free(&revs->diffopt) revisions API: have release_revisions() release "topo_walk_info" revisions API: have release_revisions() release "date_mode" revisions API: call diff_free(&revs->pruning) in revisions_release() revisions API: release "reflog_info" in release revisions() revisions API: clear "boundary_commits" in release_revisions() revisions API: have release_revisions() release "prune_data" revisions API: have release_revisions() release "grep_filter" revisions API: have release_revisions() release "filter" revisions API: have release_revisions() release "cmdline" revisions API: have release_revisions() release "mailmap" revisions API: have release_revisions() release "commits" revisions API users: use release_revisions() for "prune_data" users revisions API users: use release_revisions() with UNLEAK() revisions API users: use release_revisions() in builtin/log.c revisions API users: use release_revisions() in http-push.c revisions API users: add "goto cleanup" for release_revisions() stash: always have the owner of "stash_info" free it revisions API users: use release_revisions() needing REV_INFO_INIT revision.[ch]: document and move code declared around "init" ...
This commit is contained in:
19
commit.c
19
commit.c
@ -407,17 +407,14 @@ int parse_commit_buffer(struct repository *r, struct commit *item, const void *b
|
||||
|
||||
if (item->object.parsed)
|
||||
return 0;
|
||||
|
||||
if (item->parents) {
|
||||
/*
|
||||
* Presumably this is leftover from an earlier failed parse;
|
||||
* clear it out in preparation for us re-parsing (we'll hit the
|
||||
* same error, but that's good, since it lets our caller know
|
||||
* the result cannot be trusted.
|
||||
*/
|
||||
free_commit_list(item->parents);
|
||||
item->parents = NULL;
|
||||
}
|
||||
/*
|
||||
* Presumably this is leftover from an earlier failed parse;
|
||||
* clear it out in preparation for us re-parsing (we'll hit the
|
||||
* same error, but that's good, since it lets our caller know
|
||||
* the result cannot be trusted.
|
||||
*/
|
||||
free_commit_list(item->parents);
|
||||
item->parents = NULL;
|
||||
|
||||
tail += size;
|
||||
if (tail <= bufptr + tree_entry_len + 1 || memcmp(bufptr, "tree ", 5) ||
|
||||
|
Reference in New Issue
Block a user