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

github.com/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-07-18 23:31:54 +0300
committerJunio C Hamano <gitster@pobox.com>2022-07-18 23:31:54 +0300
commit44357f64f661635661275fe71e194974a3302049 (patch)
treee2e37facb8123d1a2c16819d9d4cf1a6489d7fbf /submodule.c
parentf01315ef7d8144ca06cd8f3fdbd6c9563e815e89 (diff)
parentece3974ba6018416ad4184c540f85d9db9b060b5 (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.c3
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);