diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-09-29 05:23:43 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-09-29 05:23:43 +0300 |
commit | 69c54c72845ebc686d0f4bdd8d44b06f799b0a80 (patch) | |
tree | bbd4e768952cbd26dd7ddaec0ab915fcda9987a8 /builtin/fast-export.c | |
parent | 14a8168e2fed3934f1f9afb286f1c64345d06790 (diff) | |
parent | 4d01a7fa65c50e817a935396432e199b7a565f53 (diff) |
Merge branch 'ma/leakplugs'
Memory leaks in various codepaths have been plugged.
* ma/leakplugs:
pack-bitmap[-write]: use `object_array_clear()`, don't leak
object_array: add and use `object_array_pop()`
object_array: use `object_array_clear()`, not `free()`
leak_pending: use `object_array_clear()`, not `free()`
commit: fix memory leak in `reduce_heads()`
builtin/commit: fix memory leak in `prepare_index()`
Diffstat (limited to 'builtin/fast-export.c')
-rw-r--r-- | builtin/fast-export.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/fast-export.c b/builtin/fast-export.c index da42ee5e60..2fb60d6d48 100644 --- a/builtin/fast-export.c +++ b/builtin/fast-export.c @@ -650,11 +650,10 @@ static void handle_tail(struct object_array *commits, struct rev_info *revs, { struct commit *commit; while (commits->nr) { - commit = (struct commit *)commits->objects[commits->nr - 1].item; + commit = (struct commit *)object_array_pop(commits); if (has_unshown_parent(commit)) return; handle_commit(commit, revs, paths_of_changed_objects); - commits->nr--; } } |