diff options
| author | Junio C Hamano <gitster@pobox.com> | 2022-03-13 22:56:18 +0000 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2022-03-13 22:56:18 +0000 |
| commit | ccafbbfb4ee29ee3e9fab1e5e22ec3b88a5aec4f (patch) | |
| tree | 58589a4ee55858487b7758d5f9ef553da0f6b542 /builtin/commit-graph.c | |
| parent | Merge branch 'nj/read-tree-doc-reffix' (diff) | |
| parent | repository.c: free the "path cache" in repo_clear() (diff) | |
| download | git-ccafbbfb4ee29ee3e9fab1e5e22ec3b88a5aec4f.tar.gz git-ccafbbfb4ee29ee3e9fab1e5e22ec3b88a5aec4f.zip | |
Merge branch 'ab/plug-random-leaks'
Plug random memory leaks.
* ab/plug-random-leaks:
repository.c: free the "path cache" in repo_clear()
range-diff: plug memory leak in read_patches()
range-diff: plug memory leak in common invocation
lockfile API users: simplify and don't leak "path"
commit-graph: stop fill_oids_from_packs() progress on error and free()
commit-graph: fix memory leak in misused string_list API
submodule--helper: fix trivial leak in module_add()
transport: stop needlessly copying bundle header references
bundle: call strvec_clear() on allocated strvec
remote-curl.c: free memory in cmd_main()
urlmatch.c: add and use a *_release() function
diff.c: free "buf" in diff_words_flush()
merge-base: free() allocated "struct commit **" list
index-pack: fix memory leaks
Diffstat (limited to 'builtin/commit-graph.c')
| -rw-r--r-- | builtin/commit-graph.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/builtin/commit-graph.c b/builtin/commit-graph.c index 4247fbde95..51c4040ea6 100644 --- a/builtin/commit-graph.c +++ b/builtin/commit-graph.c @@ -192,7 +192,7 @@ static int git_commit_graph_write_config(const char *var, const char *value, static int graph_write(int argc, const char **argv) { - struct string_list pack_indexes = STRING_LIST_INIT_NODUP; + struct string_list pack_indexes = STRING_LIST_INIT_DUP; struct strbuf buf = STRBUF_INIT; struct oidset commits = OIDSET_INIT; struct object_directory *odb = NULL; @@ -273,8 +273,8 @@ static int graph_write(int argc, const char **argv) if (opts.stdin_packs) { while (strbuf_getline(&buf, stdin) != EOF) - string_list_append(&pack_indexes, - strbuf_detach(&buf, NULL)); + string_list_append_nodup(&pack_indexes, + strbuf_detach(&buf, NULL)); } else if (opts.stdin_commits) { oidset_init(&commits, 0); if (opts.progress) |
