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 /apply.c | |
| parent | 4eb845ac0af364d65666389c6efae3f09483cd2e (diff) | |
| parent | 759f34073807119ffb935a84aa86e6a8fa7a9bc4 (diff) | |
| download | git-ccafbbfb4ee29ee3e9fab1e5e22ec3b88a5aec4f.tar.xz | |
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 'apply.c')
| -rw-r--r-- | apply.c | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -219,13 +219,18 @@ static void free_fragment_list(struct fragment *list) } } -static void free_patch(struct patch *patch) +void release_patch(struct patch *patch) { free_fragment_list(patch->fragments); free(patch->def_name); free(patch->old_name); free(patch->new_name); free(patch->result); +} + +static void free_patch(struct patch *patch) +{ + release_patch(patch); free(patch); } |
