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/sortedcache.c | |
parent | abfdb8a6d252a4834df9234ad338c97f1a4f97f2 (diff) | |
download | libgit2-0f35efeb5722f950218e3649d7814a6a91b1c351.tar.gz |
git_pool_init: handle failure casesethomson/poolinit
Propagate failures caused by pool initialization errors.
Diffstat (limited to 'src/sortedcache.c')
-rw-r--r-- | src/sortedcache.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/sortedcache.c b/src/sortedcache.c index 8f7ea23e2..ee6363f6d 100644 --- a/src/sortedcache.c +++ b/src/sortedcache.c @@ -25,9 +25,8 @@ int git_sortedcache_new( sc = git__calloc(1, alloclen); GIT_ERROR_CHECK_ALLOC(sc); - git_pool_init(&sc->pool, 1); - - if (git_vector_init(&sc->items, 4, item_cmp) < 0 || + if (git_pool_init(&sc->pool, 1) < 0 || + git_vector_init(&sc->items, 4, item_cmp) < 0 || git_strmap_new(&sc->map) < 0) goto fail; |