diff options
author | Junio C Hamano <gitster@pobox.com> | 2021-08-04 13:28:52 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-08-04 13:28:52 -0700 |
commit | 31f9acf9ce29ae210b54997f7fb388a2dc543d53 (patch) | |
tree | ec42e72471831dd47a31bd467e32b4bce6499be7 /builtin/merge.c | |
parent | Merge branch 'ar/submodule-add' (diff) | |
parent | reset: clear_unpack_trees_porcelain to plug leak (diff) | |
download | tgif-31f9acf9ce29ae210b54997f7fb388a2dc543d53.tar.xz |
Merge branch 'ah/plugleaks'
Leak plugging.
* ah/plugleaks:
reset: clear_unpack_trees_porcelain to plug leak
builtin/rebase: fix options.strategy memory lifecycle
builtin/merge: free found_ref when done
builtin/mv: free or UNLEAK multiple pointers at end of cmd_mv
convert: release strbuf to avoid leak
read-cache: call diff_setup_done to avoid leak
ref-filter: also free head for ATOM_HEAD to avoid leak
diffcore-rename: move old_dir/new_dir definition to plug leak
builtin/for-each-repo: remove unnecessary argv copy to plug leak
builtin/submodule--helper: release unused strbuf to avoid leak
environment: move strbuf into block to plug leak
fmt-merge-msg: free newly allocated temporary strings when done
Diffstat (limited to 'builtin/merge.c')
-rw-r--r-- | builtin/merge.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/merge.c b/builtin/merge.c index a8a843b1f5..7ad85c044a 100644 --- a/builtin/merge.c +++ b/builtin/merge.c @@ -503,7 +503,7 @@ static void merge_name(const char *remote, struct strbuf *msg) struct strbuf bname = STRBUF_INIT; struct merge_remote_desc *desc; const char *ptr; - char *found_ref; + char *found_ref = NULL; int len, early; strbuf_branchname(&bname, remote, 0); @@ -586,6 +586,7 @@ static void merge_name(const char *remote, struct strbuf *msg) strbuf_addf(msg, "%s\t\tcommit '%s'\n", oid_to_hex(&remote_head->object.oid), remote); cleanup: + free(found_ref); strbuf_release(&buf); strbuf_release(&bname); } |