commit 58cbcd83c93f2636813f4f8064caefd2f838a24c from: Omar Polo via: Thomas Adam date: Tue Mar 22 17:53:47 2022 UTC don't `goto done' if calloc fails otherwise we call got_repo_close with repo being NULL and segfault there. ok stsp commit - de47d040c7458d8bddac77ba76a8a5e61aa8eb44 commit + 58cbcd83c93f2636813f4f8064caefd2f838a24c blob - dc7435908d610d55270466c158a0dea7033d6b19 blob + 11d4544e566f8f5fbb07a1ac7256d3f824949198 --- lib/repository.c +++ lib/repository.c @@ -658,10 +658,8 @@ got_repo_open(struct got_repository **repop, const cha return got_error_from_errno("getrlimit"); repo = calloc(1, sizeof(*repo)); - if (repo == NULL) { - err = got_error_from_errno("calloc"); - goto done; - } + if (repo == NULL) + return got_error_from_errno("calloc"); RB_INIT(&repo->packidx_bloom_filters); TAILQ_INIT(&repo->packidx_paths);