summaryrefslogtreecommitdiff
path: root/src/remote.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/remote.c')
-rw-r--r--src/remote.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/remote.c b/src/remote.c
index 8f302a51e..31ee97795 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -356,8 +356,8 @@ int git_remote_load(git_remote **out, git_repository *repo, const char *name)
if ((error = ensure_remote_name_is_valid(name)) < 0)
return error;
- if (git_repository_config__weakptr(&config, repo) < 0)
- return -1;
+ if ((error = git_repository_config_snapshot(&config, repo)) < 0)
+ return error;
remote = git__malloc(sizeof(git_remote));
GITERR_CHECK_ALLOC(remote);
@@ -437,6 +437,7 @@ int git_remote_load(git_remote **out, git_repository *repo, const char *name)
*out = remote;
cleanup:
+ git_config_free(config);
git_buf_free(&buf);
if (error < 0)