diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2015-06-10 10:23:08 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2015-06-10 10:23:08 +0200 |
commit | 2d73075a41628634fa0c5572d760ad3aafffcf82 (patch) | |
tree | 3373981f68ea3a00a54700c4cf2c0c2caf88ab84 | |
parent | a166466cd199a1c4e374af1f6985b2572e261da0 (diff) | |
download | libgit2-2d73075a41628634fa0c5572d760ad3aafffcf82.tar.gz |
cache: add a check for a failed allocation
Rather minimal change, but it's the kind of thing we should do.
-rw-r--r-- | src/cache.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cache.c b/src/cache.c index 8dc9cbf9c..2f3ad1563 100644 --- a/src/cache.c +++ b/src/cache.c @@ -68,6 +68,7 @@ int git_cache_init(git_cache *cache) { memset(cache, 0, sizeof(*cache)); cache->map = git_oidmap_alloc(); + GITERR_CHECK_ALLOC(cache->map); if (git_rwlock_init(&cache->lock)) { giterr_set(GITERR_OS, "Failed to initialize cache rwlock"); return -1; |