diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-08-09 10:13:13 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-08-09 10:13:13 -0700 |
commit | 203cf46fac096185701e50cdbf972ba6a67a10c8 (patch) | |
tree | 0a62ed44aa173521d08eff4514e8139c6e78b941 | |
parent | c2a8c3701b25929b6df2a999b3e8d1a19ee55fc0 (diff) | |
parent | 0aa6bce7365c97ab1e26791ee03b3a83f7e784dd (diff) | |
download | git-203cf46fac096185701e50cdbf972ba6a67a10c8.tar.gz |
Merge branch 'ds/commit-graph-incremental'
Leakfix.
* ds/commit-graph-incremental:
commit-graph: release strbufs after use
-rw-r--r-- | commit-graph.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/commit-graph.c b/commit-graph.c index 90fdee9256..fe954ab5f8 100644 --- a/commit-graph.c +++ b/commit-graph.c @@ -434,6 +434,7 @@ static struct commit_graph *load_commit_graph_chain(struct repository *r, const free(oids); fclose(fp); + strbuf_release(&line); return graph_chain; } @@ -1186,7 +1187,7 @@ static int fill_oids_from_packs(struct write_commit_graph_context *ctx, } stop_progress(&ctx->progress); - strbuf_reset(&progress_title); + strbuf_release(&progress_title); strbuf_release(&packname); return 0; @@ -1713,10 +1714,8 @@ static void expire_commit_graphs(struct write_commit_graph_context *ctx) strbuf_addstr(&path, "/info/commit-graphs"); dir = opendir(path.buf); - if (!dir) { - strbuf_release(&path); - return; - } + if (!dir) + goto out; strbuf_addch(&path, '/'); dirnamelen = path.len; @@ -1745,6 +1744,9 @@ static void expire_commit_graphs(struct write_commit_graph_context *ctx) if (!found) unlink(path.buf); } + +out: + strbuf_release(&path); } int write_commit_graph(const char *obj_dir, |