diff options
author | Junio C Hamano <gitster@pobox.com> | 2022-07-18 23:31:54 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-07-18 23:31:54 +0300 |
commit | 44357f64f661635661275fe71e194974a3302049 (patch) | |
tree | e2e37facb8123d1a2c16819d9d4cf1a6489d7fbf /submodule.c | |
parent | f01315ef7d8144ca06cd8f3fdbd6c9563e815e89 (diff) | |
parent | ece3974ba6018416ad4184c540f85d9db9b060b5 (diff) |
Merge branch 'ab/leakfix'
Plug various memory leaks.
* ab/leakfix:
pull: fix a "struct oid_array" memory leak
cat-file: fix a common "struct object_context" memory leak
gc: fix a memory leak
checkout: avoid "struct unpack_trees_options" leak
merge-file: fix memory leaks on error path
merge-file: refactor for subsequent memory leak fix
cat-file: fix a memory leak in --batch-command mode
revert: free "struct replay_opts" members
submodule.c: free() memory from xgetcwd()
clone: fix memory leak in wanted_peer_refs()
check-ref-format: fix trivial memory leak
Diffstat (limited to 'submodule.c')
-rw-r--r-- | submodule.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/submodule.c b/submodule.c index 2af16c647d5..3fa5db3ecdf 100644 --- a/submodule.c +++ b/submodule.c @@ -2388,7 +2388,7 @@ int get_superproject_working_tree(struct strbuf *buf) struct child_process cp = CHILD_PROCESS_INIT; struct strbuf sb = STRBUF_INIT; struct strbuf one_up = STRBUF_INIT; - const char *cwd = xgetcwd(); + char *cwd = xgetcwd(); int ret = 0; const char *subpath; int code; @@ -2451,6 +2451,7 @@ int get_superproject_working_tree(struct strbuf *buf) ret = 1; free(super_wt); } + free(cwd); strbuf_release(&sb); code = finish_command(&cp); |