commit 599785e85d854563801d9640012f93e799ff87ea from: Omar Polo via: Thomas Adam date: Sun Sep 04 15:52:15 2022 UTC got_commit_graph_close: free tailq contents The tailq should ideally be empty when we reach got_commit_graph_close, but consumer code may exit the commit graph loop earlier. spotted by and ok stsp@ commit - 8dbcf3885ae920e0fd38a455e7577824989a605f commit + 599785e85d854563801d9640012f93e799ff87ea blob - 5fb4e1e85c7a74b5eb7ad59732f75f45ac841f7a blob + 433147d759abe949b7efd514d370f93b4c975e13 --- lib/commit_graph.c +++ lib/commit_graph.c @@ -534,6 +534,13 @@ done: void got_commit_graph_close(struct got_commit_graph *graph) { + struct got_commit_graph_node *node; + + while ((node = TAILQ_FIRST(&graph->iter_list))) { + TAILQ_REMOVE(&graph->iter_list, node, entry); + free(node); + } + if (graph->open_branches) got_object_idset_free(graph->open_branches); if (graph->node_ids)