Skip to content

Commit 22d013b

Browse files
committed
remote: set the error before cleanup
Otherwise we'll return stack data to the caller.
1 parent ad95873 commit 22d013b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/remote.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ static int get_optional_config(
428428

429429
int git_remote_lookup(git_remote **out, git_repository *repo, const char *name)
430430
{
431-
git_remote *remote;
431+
git_remote *remote = NULL;
432432
git_buf buf = GIT_BUF_INIT;
433433
const char *val;
434434
int error = 0;
@@ -510,7 +510,7 @@ int git_remote_lookup(git_remote **out, git_repository *repo, const char *name)
510510
if ((error = get_optional_config(NULL, config, &buf, refspec_cb, &data)) < 0)
511511
goto cleanup;
512512

513-
if (download_tags_value(remote, config) < 0)
513+
if ((error = download_tags_value(remote, config)) < 0)
514514
goto cleanup;
515515

516516
if ((error = lookup_remote_prune_config(remote, config, name)) < 0)

0 commit comments

Comments
 (0)