commit 6650dd540f869526b5f0363eb90f84d926a88196 from: Stefan Sperling date: Sat Feb 01 15:19:24 2025 UTC in repaint_parent_commits(), handle some errors properly commit - d6d823b59e827b8a12735aafd4f949452cd44ded commit + 6650dd540f869526b5f0363eb90f84d926a88196 blob - 5539e57fe78d198adbc58263d785931d0b4eb55c blob + 72d17533c84b72b457d828ec6a13aad430991e02 --- 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);