Skip to content

Commit 8c611fa

Browse files
committed
Merge branch 'ly/submodule-update-failure-leakfix' into jch
* ly/submodule-update-failure-leakfix: builtin/submodule--helper: fix leak when remote_submodule_branch() failed
2 parents 71971f4 + bfc9f9c commit 8c611fa

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

builtin/submodule--helper.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2663,8 +2663,10 @@ static int update_submodule(struct update_data *update_data)
26632663
if (code)
26642664
return code;
26652665
code = remote_submodule_branch(update_data->sm_path, &branch);
2666-
if (code)
2666+
if (code) {
2667+
free(remote_name);
26672668
return code;
2669+
}
26682670
remote_ref = xstrfmt("refs/remotes/%s/%s", remote_name, branch);
26692671

26702672
free(remote_name);

0 commit comments

Comments
 (0)