summaryrefslogtreecommitdiff
path: root/commit-graph.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2019-08-07 11:15:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-08-07 19:24:01 (GMT)
commit0aa6bce7365c97ab1e26791ee03b3a83f7e784dd (patch)
treeb9e4993b19fe5e0f62629f4253d0e259497c9937 /commit-graph.c
parent5b15eb397d176c557a82e872d6b4043aa7589874 (diff)
downloadgit-0aa6bce7365c97ab1e26791ee03b3a83f7e784dd.zip
git-0aa6bce7365c97ab1e26791ee03b3a83f7e784dd.tar.gz
git-0aa6bce7365c97ab1e26791ee03b3a83f7e784dd.tar.bz2
commit-graph: release strbufs after use
Signed-off-by: René Scharfe <l.s.r@web.de> Acked-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-graph.c')
-rw-r--r--commit-graph.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/commit-graph.c b/commit-graph.c
index c91e6f0..fa0760c 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -432,6 +432,7 @@ static struct commit_graph *load_commit_graph_chain(struct repository *r, const
free(oids);
fclose(fp);
+ strbuf_release(&line);
return graph_chain;
}
@@ -1179,7 +1180,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;
@@ -1706,10 +1707,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;
@@ -1738,6 +1737,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,