summaryrefslogtreecommitdiff
path: root/src/odb.c
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2011-05-15 06:57:34 +0200
committernulltoken <emeric.fermas@gmail.com>2011-05-15 06:57:34 +0200
commit81201a4c4d1e8704260ab4572eb6c480d576fe83 (patch)
treef904ca7a97fb3423ebec1f5cd04ed244a4a5d8b7 /src/odb.c
parent3abe3bba5ab234a8fcbf4cc7a50adc86323d7287 (diff)
downloadlibgit2-81201a4c4d1e8704260ab4572eb6c480d576fe83.tar.gz
Move cache.c to the new error handling
Diffstat (limited to 'src/odb.c')
-rw-r--r--src/odb.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/odb.c b/src/odb.c
index e9e495eb1..025b591c5 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -234,13 +234,17 @@ static int backend_sort_cmp(const void *a, const void *b)
int git_odb_new(git_odb **out)
{
+ int error;
+
git_odb *db = git__calloc(1, sizeof(*db));
if (!db)
return GIT_ENOMEM;
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) < 0) {
+ if (git_vector_init(&db->backends, 4, backend_sort_cmp) < GIT_SUCCESS) {
free(db);
return GIT_ENOMEM;
}