Commit 35168571 by Patrick Steinhardt

iterator: remove duplicate memset

When allocating new tree iterator frames, we zero out the allocated
memory twice. Remove one of the `memset` calls.
parent f647d021
......@@ -543,8 +543,6 @@ static int tree_iterator_frame_init(
new_frame = git_array_alloc(iter->frames);
GIT_ERROR_CHECK_ALLOC(new_frame);
memset(new_frame, 0, sizeof(tree_iterator_frame));
if ((error = git_tree_dup(&dup, tree)) < 0)
goto done;
......@@ -558,8 +556,8 @@ static int tree_iterator_frame_init(
cmp = iterator__ignore_case(&iter->base) ?
tree_iterator_entry_sort_icase : NULL;
if ((error = git_vector_init(
&new_frame->entries, dup->entries.size, cmp)) < 0)
if ((error = git_vector_init(&new_frame->entries,
dup->entries.size, cmp)) < 0)
goto done;
git_array_foreach(dup->entries, i, tree_entry) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment