On Sat, Aug 30, 2025 at 09:23:24PM +0000, Derrick Stolee via GitGitGadget wrote: > diff --git a/midx-write.c b/midx-write.c > index 0f1d5653ab..cb0211289d 100644 > --- a/midx-write.c > +++ b/midx-write.c > @@ -1327,13 +1327,15 @@ static int write_midx_internal(struct repository *r, const char *object_dir, > incr = mks_tempfile_m(midx_name.buf, 0444); > if (!incr) { > error(_("unable to create temporary MIDX layer")); > - return -1; > + result = -1; > + goto cleanup; We can instead use `result = error(...); goto cleanup;` here and in most other cases. Patrick