[PATCH 15/20] builtin/merge.c: always free "struct strbuf msg"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Follow-up 465028e0e25 (merge: add missing strbuf_release(),
2021-10-07) and free "&msg" also when we'd "goto done" from the scope
it's allocated in.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx>
---
 builtin/merge.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/builtin/merge.c b/builtin/merge.c
index 0f093f2a4f2..8f78f326dbe 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -1577,6 +1577,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 		commit = remoteheads->item;
 		if (!commit) {
 			ret = 1;
+			strbuf_release(&msg);
 			goto done;
 		}
 
@@ -1589,6 +1590,7 @@ int cmd_merge(int argc, const char **argv, const char *prefix)
 					  overwrite_ignore)) {
 			apply_autostash(git_path_merge_autostash(the_repository));
 			ret = 1;
+			strbuf_release(&msg);
 			goto done;
 		}
 
-- 
2.39.0.1153.gb0033028ca9




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux