Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-03-14 01:56:18 +0300
committerJunio C Hamano <gitster@pobox.com>2022-03-14 01:56:18 +0300
commitccafbbfb4ee29ee3e9fab1e5e22ec3b88a5aec4f (patch)
tree58589a4ee55858487b7758d5f9ef553da0f6b542 /builtin/index-pack.c
parent4eb845ac0af364d65666389c6efae3f09483cd2e (diff)
parent759f34073807119ffb935a84aa86e6a8fa7a9bc4 (diff)
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/index-pack.c')
-rw-r--r--builtin/index-pack.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index c45273de3b..38fb4f4e55 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -1113,6 +1113,7 @@ static void *threaded_second_pass(void *data)
list_add(&child->list, &work_head);
base_cache_used += child->size;
prune_base_data(NULL);
+ free_base_data(child);
} else {
/*
* This child does not have its own children. It may be
@@ -1135,6 +1136,7 @@ static void *threaded_second_pass(void *data)
p = next_p;
}
+ FREE_AND_NULL(child);
}
work_unlock();
}
@@ -1428,6 +1430,7 @@ static void fix_unresolved_deltas(struct hashfile *f)
* object).
*/
append_obj_to_pack(f, d->oid.hash, data, size, type);
+ free(data);
threaded_second_pass(NULL);
display_progress(progress, nr_resolved_deltas);
@@ -1707,6 +1710,7 @@ static void show_pack_info(int stat_only)
i + 1,
chain_histogram[i]);
}
+ free(chain_histogram);
}
int cmd_index_pack(int argc, const char **argv, const char *prefix)
@@ -1936,6 +1940,7 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix)
if (do_fsck_object && fsck_finish(&fsck_options))
die(_("fsck error in pack objects"));
+ free(opts.anomaly);
free(objects);
strbuf_release(&index_name_buf);
strbuf_release(&rev_index_name_buf);