Skip to content

Commit 203cf46

Browse files
committed
Merge branch 'ds/commit-graph-incremental'
Leakfix. * ds/commit-graph-incremental: commit-graph: release strbufs after use
2 parents c2a8c37 + 0aa6bce commit 203cf46

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

commit-graph.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,7 @@ static struct commit_graph *load_commit_graph_chain(struct repository *r, const
434434

435435
free(oids);
436436
fclose(fp);
437+
strbuf_release(&line);
437438

438439
return graph_chain;
439440
}
@@ -1186,7 +1187,7 @@ static int fill_oids_from_packs(struct write_commit_graph_context *ctx,
11861187
}
11871188

11881189
stop_progress(&ctx->progress);
1189-
strbuf_reset(&progress_title);
1190+
strbuf_release(&progress_title);
11901191
strbuf_release(&packname);
11911192

11921193
return 0;
@@ -1713,10 +1714,8 @@ static void expire_commit_graphs(struct write_commit_graph_context *ctx)
17131714
strbuf_addstr(&path, "/info/commit-graphs");
17141715
dir = opendir(path.buf);
17151716

1716-
if (!dir) {
1717-
strbuf_release(&path);
1718-
return;
1719-
}
1717+
if (!dir)
1718+
goto out;
17201719

17211720
strbuf_addch(&path, '/');
17221721
dirnamelen = path.len;
@@ -1745,6 +1744,9 @@ static void expire_commit_graphs(struct write_commit_graph_context *ctx)
17451744
if (!found)
17461745
unlink(path.buf);
17471746
}
1747+
1748+
out:
1749+
strbuf_release(&path);
17481750
}
17491751

17501752
int write_commit_graph(const char *obj_dir,

0 commit comments

Comments
 (0)