mirror of
https://github.com/git/git.git
synced 2026-01-12 05:43:12 +09:00
Merge branch 'ly/submodule-update-failure-leakfix'
A memory leak on an error code path has been plugged. * ly/submodule-update-failure-leakfix: builtin/submodule--helper: fix leak when remote_submodule_branch() failed
This commit is contained in:
commit
92daf08c84
@ -2660,8 +2660,10 @@ static int update_submodule(struct update_data *update_data)
|
||||
if (code)
|
||||
return code;
|
||||
code = remote_submodule_branch(update_data->sm_path, &branch);
|
||||
if (code)
|
||||
if (code) {
|
||||
free(remote_name);
|
||||
return code;
|
||||
}
|
||||
remote_ref = xstrfmt("refs/remotes/%s/%s", remote_name, branch);
|
||||
|
||||
free(remote_name);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user