mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-09 05:28:34 +00:00
remote: set error code in create_internal
Set the error code when an error occurs in any of the called functions. This ensures we pass the error up to callers and actually free the remote when an error occurs.
This commit is contained in:
parent
0f1e2d2066
commit
d0cb11e794
@ -208,8 +208,8 @@ static int create_internal(git_remote **out, git_repository *repo, const char *n
|
||||
|
||||
remote->repo = repo;
|
||||
|
||||
if (git_vector_init(&remote->refs, 32, NULL) < 0 ||
|
||||
canonicalize_url(&canonical_url, url) < 0)
|
||||
if ((error = git_vector_init(&remote->refs, 32, NULL)) < 0 ||
|
||||
(error = canonicalize_url(&canonical_url, url)) < 0)
|
||||
goto on_error;
|
||||
|
||||
remote->url = apply_insteadof(repo->_config, canonical_url.ptr, GIT_DIRECTION_FETCH);
|
||||
|
Loading…
Reference in New Issue
Block a user