diff options
| author | nulltoken <emeric.fermas@gmail.com> | 2011-05-15 06:57:34 +0200 |
|---|---|---|
| committer | nulltoken <emeric.fermas@gmail.com> | 2011-05-15 06:57:34 +0200 |
| commit | 81201a4c4d1e8704260ab4572eb6c480d576fe83 (patch) | |
| tree | f904ca7a97fb3423ebec1f5cd04ed244a4a5d8b7 /src/odb.c | |
| parent | 3abe3bba5ab234a8fcbf4cc7a50adc86323d7287 (diff) | |
| download | libgit2-81201a4c4d1e8704260ab4572eb6c480d576fe83.tar.gz | |
Move cache.c to the new error handling
Diffstat (limited to 'src/odb.c')
| -rw-r--r-- | src/odb.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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; } |
