diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2020-05-23 10:15:51 +0100 |
---|---|---|
committer | Patrick Steinhardt <ps@pks.im> | 2020-06-01 14:12:17 +0200 |
commit | 0f35efeb5722f950218e3649d7814a6a91b1c351 (patch) | |
tree | e53af9e934365660d0bacfd4c24b40434dfd353f /src/diff_tform.c | |
parent | abfdb8a6d252a4834df9234ad338c97f1a4f97f2 (diff) | |
download | libgit2-ethomson/poolinit.tar.gz |
git_pool_init: handle failure casesethomson/poolinit
Propagate failures caused by pool initialization errors.
Diffstat (limited to 'src/diff_tform.c')
-rw-r--r-- | src/diff_tform.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/diff_tform.c b/src/diff_tform.c index 437144ae2..7de88bd0d 100644 --- a/src/diff_tform.c +++ b/src/diff_tform.c @@ -136,11 +136,10 @@ int git_diff__merge( return -1; } - if (git_vector_init(&onto_new, onto->deltas.length, git_diff_delta__cmp) < 0) + if (git_vector_init(&onto_new, onto->deltas.length, git_diff_delta__cmp) < 0 || + git_pool_init(&onto_pool, 1) < 0) return -1; - git_pool_init(&onto_pool, 1); - for (i = 0, j = 0; i < onto->deltas.length || j < from->deltas.length; ) { git_diff_delta *o = GIT_VECTOR_GET(&onto->deltas, i); const git_diff_delta *f = GIT_VECTOR_GET(&from->deltas, j); |