commit b4d10c2be91fc52b9f65798b6a4f55afbdd9f3eb from: Omar Polo via: Thomas Adam date: Mon Jan 23 18:21:06 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 - 53bf32b82a90b42a6feff46808c401af5d59f2c6 commit + b4d10c2be91fc52b9f65798b6a4f55afbdd9f3eb blob - 125258a15fc66665090af8fe98d6c3a3a3dd15fc blob + 2664322206ab8d6e2b8e885d18a53cd4011457b8 --- 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))