We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents cb150e6 + dd45539 commit d900ddeCopy full SHA for d900dde
src/odb.c
@@ -443,8 +443,12 @@ int git_odb_new(git_odb **out)
443
git_odb *db = git__calloc(1, sizeof(*db));
444
GIT_ERROR_CHECK_ALLOC(db);
445
446
- if (git_cache_init(&db->own_cache) < 0 ||
447
- git_vector_init(&db->backends, 4, backend_sort_cmp) < 0) {
+ if (git_cache_init(&db->own_cache) < 0) {
+ git__free(db);
448
+ return -1;
449
+ }
450
+ if (git_vector_init(&db->backends, 4, backend_sort_cmp) < 0) {
451
+ git_cache_free(&db->own_cache);
452
git__free(db);
453
return -1;
454
}
0 commit comments