commit aa31714b5b44e1b79b15792902586d60da22e47a from: Omar Polo date: Sun Jan 22 11:17:51 2023 UTC gotwebd: don't got_ref_list per-commit in got_get_repo_commits It's wasteful since `refs' is already populated before the loop, and released after. It also leaks the content of `refs' the first time the loop is entered. ok jamsek commit - cb93ab40659f5d64c7a4f56919d203efa2d8a565 commit + aa31714b5b44e1b79b15792902586d60da22e47a blob - 78b5a2623d4338f679a254321a0a0647a5ff85fd blob + cb7924b39f5629118d7515bb7ae7bce48d66c550 --- gotwebd/got_operations.c +++ gotwebd/got_operations.c @@ -433,11 +433,6 @@ got_get_repo_commits(struct request *c, int limit) } error = got_object_open_as_commit(&commit, repo, &next_id); - if (error) - goto done; - - error = got_ref_list(&refs, repo, NULL, got_ref_cmp_by_name, - NULL); if (error) goto done; @@ -505,7 +500,6 @@ got_get_repo_commits(struct request *c, int limit) goto done; } } - got_ref_list_free(&refs); if (error || (limit && --limit == 0)) { if (commit_found || (qs->file != NULL && strlen(qs->file) > 0))