summaryrefslogtreecommitdiff
path: root/src/iterator.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2020-05-23 10:15:51 +0100
committerPatrick Steinhardt <ps@pks.im>2020-06-01 14:12:17 +0200
commit0f35efeb5722f950218e3649d7814a6a91b1c351 (patch)
treee53af9e934365660d0bacfd4c24b40434dfd353f /src/iterator.c
parentabfdb8a6d252a4834df9234ad338c97f1a4f97f2 (diff)
downloadlibgit2-0f35efeb5722f950218e3649d7814a6a91b1c351.tar.gz
git_pool_init: handle failure casesethomson/poolinit
Propagate failures caused by pool initialization errors.
Diffstat (limited to 'src/iterator.c')
-rw-r--r--src/iterator.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/iterator.c b/src/iterator.c
index e26e2c0c7..a393187c0 100644
--- a/src/iterator.c
+++ b/src/iterator.c
@@ -897,9 +897,8 @@ static int tree_iterator_init(tree_iterator *iter)
{
int error;
- git_pool_init(&iter->entry_pool, sizeof(tree_iterator_entry));
-
- if ((error = tree_iterator_frame_init(iter, iter->root, NULL)) < 0)
+ if ((error = git_pool_init(&iter->entry_pool, sizeof(tree_iterator_entry))) < 0 ||
+ (error = tree_iterator_frame_init(iter, iter->root, NULL)) < 0)
return error;
iter->base.flags &= ~GIT_ITERATOR_FIRST_ACCESS;
@@ -1376,7 +1375,8 @@ static int filesystem_iterator_frame_push(
filesystem_iterator_entry_cmp)) < 0)
goto done;
- git_pool_init(&new_frame->entry_pool, 1);
+ if ((error = git_pool_init(&new_frame->entry_pool, 1)) < 0)
+ goto done;
/* check if this directory is ignored */
filesystem_iterator_frame_push_ignores(iter, frame_entry, new_frame);