From 7cadd1f6a788dbb997997481f09a2e430cc94958 Mon Sep 17 00:00:00 2001 From: Vicent Marti Date: Sun, 15 May 2011 23:46:22 +0300 Subject: [PATCH] Check error code from `git_cache_init` --- src/odb.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/odb.c b/src/odb.c index 8637534c1..f09b6d7e9 100644 --- a/src/odb.c +++ b/src/odb.c @@ -240,13 +240,13 @@ int git_odb_new(git_odb **out) if (!db) return GIT_ENOMEM; - git_cache_init(&db->cache, GIT_DEFAULT_CACHE_SIZE, &free_odb_object); + error = git_cache_init(&db->cache, GIT_DEFAULT_CACHE_SIZE, &free_odb_object); if (error < GIT_SUCCESS) return error; - if (git_vector_init(&db->backends, 4, backend_sort_cmp) < GIT_SUCCESS) { + if ((error = git_vector_init(&db->backends, 4, backend_sort_cmp)) < GIT_SUCCESS) { free(db); - return GIT_ENOMEM; + return error; } *out = db;