diff options
author | Junio C Hamano <gitster@pobox.com> | 2017-09-29 04:23:43 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-09-29 04:23:43 +0200 |
commit | 69c54c72845ebc686d0f4bdd8d44b06f799b0a80 (patch) | |
tree | bbd4e768952cbd26dd7ddaec0ab915fcda9987a8 /builtin/fsck.c | |
parent | Merge branch 'rj/no-sign-compare' (diff) | |
parent | pack-bitmap[-write]: use `object_array_clear()`, don't leak (diff) | |
download | git-69c54c72845ebc686d0f4bdd8d44b06f799b0a80.tar.xz git-69c54c72845ebc686d0f4bdd8d44b06f799b0a80.zip |
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/fsck.c')
-rw-r--r-- | builtin/fsck.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/builtin/fsck.c b/builtin/fsck.c index 1e4c471b41..56afe405b8 100644 --- a/builtin/fsck.c +++ b/builtin/fsck.c @@ -182,12 +182,7 @@ static int traverse_reachable(void) if (show_progress) progress = start_delayed_progress(_("Checking connectivity"), 0); while (pending.nr) { - struct object_array_entry *entry; - struct object *obj; - - entry = pending.objects + --pending.nr; - obj = entry->item; - result |= traverse_one_object(obj); + result |= traverse_one_object(object_array_pop(&pending)); display_progress(progress, ++nr); } stop_progress(&progress); |