summaryrefslogtreecommitdiff
path: root/src/apply.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/apply.c
parentabfdb8a6d252a4834df9234ad338c97f1a4f97f2 (diff)
downloadlibgit2-ethomson/poolinit.tar.gz
git_pool_init: handle failure casesethomson/poolinit
Propagate failures caused by pool initialization errors.
Diffstat (limited to 'src/apply.c')
-rw-r--r--src/apply.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/apply.c b/src/apply.c
index fc60e1418..f90166343 100644
--- a/src/apply.c
+++ b/src/apply.c
@@ -63,7 +63,8 @@ static int patch_image_init_fromstr(
memset(out, 0x0, sizeof(patch_image));
- git_pool_init(&out->pool, sizeof(git_diff_line));
+ if (git_pool_init(&out->pool, sizeof(git_diff_line)) < 0)
+ return -1;
for (start = in; start < in + in_len; start = end) {
end = memchr(start, '\n', in_len - (start - in));