commit 781eeac34260f564a125604e8368f21b88f97bddd6a6a8f46c94af7db63f8fdc from: Stefan Sperling date: Sat Feb 1 15:19:24 2025 UTC in repaint_parent_commits(), handle some errors properly commit - 7904dae25554a352199a3a292953b9d776b81bb07d4bb276b64a2dd1144a961d commit + 781eeac34260f564a125604e8368f21b88f97bddd6a6a8f46c94af7db63f8fdc blob - deec3b6590375dae3efb56f4926bb0b823b04c2ae2b110a66b27ccf0a643b640 blob + 4f267def2ff3f2b44bcf7881c8bbf58e5680ec24ec27becad84b26e9769145e5 --- libexec/got-read-pack/got-read-pack.c +++ libexec/got-read-pack/got-read-pack.c @@ -1722,9 +1722,10 @@ repaint_parent_commits(struct got_object_id *commit_id got_object_idset_contains(skip, &pid->id)) continue; - err = queue_commit_id(&repaint, &pid->id, color); + err = queue_commit_id(&repaint, &pid->id, + color); if (err) - break; + goto done; } } got_object_commit_close(commit); @@ -1750,7 +1751,9 @@ repaint_parent_commits(struct got_object_id *commit_id STAILQ_FOREACH(qid, painted, entry) { if (got_object_id_cmp(&qid->id, &pid->id) != 0) continue; - paint_commit(qid, color); + err = paint_commit(qid, color); + if (err) + goto done; got_object_qid_free(pid); pid = qid; break; @@ -1767,7 +1770,9 @@ repaint_parent_commits(struct got_object_id *commit_id STAILQ_FOREACH_SAFE(qid, ids, entry, tmp) { if (got_object_id_cmp(&qid->id, &pid->id) != 0) continue; - paint_commit(qid, color); + err = paint_commit(qid, color); + if (err) + goto done; break; } @@ -1787,7 +1792,7 @@ repaint_parent_commits(struct got_object_id *commit_id break; } } - +done: if (commit) got_object_commit_close(commit); got_object_id_queue_free(&repaint);