commit c560c1f52d2adb8966e2f783ed7d3f0b37117df9 from: Omar Polo date: Mon Mar 14 13:50:31 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 - 9b576444ae8786f3cc494c57cb8e7a64b74970db commit + c560c1f52d2adb8966e2f783ed7d3f0b37117df9 blob - bea8c8ad1e87cf8b7547d55c5b292380e389a38f blob + 83c3cd05b0c14e01e854dae33a93f8d30c3dac64 --- lib/repository.c +++ lib/repository.c @@ -664,10 +664,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);