Prevent repository config from leaking

This commit is contained in:
Kevin Sawicki
2013-03-04 19:05:55 -08:00
parent 8b7e3c1092
commit 673e8c948f

View File

@@ -114,9 +114,6 @@ namespace v8_extensions {
void GetUpstreamBranch(const char** out, git_reference *branch) {
*out = NULL;
git_config *config;
if (git_repository_config(&config, repo) != GIT_OK)
return;
const char* branchName = git_reference_name(branch);
const char* shortBranchName;
@@ -133,6 +130,10 @@ namespace v8_extensions {
sprintf(mergeKey, "branch.%s.merge", shortBranchName);
free((char*)shortBranchName);
git_config *config;
if (git_repository_config(&config, repo) != GIT_OK)
return;
const char *remote;
const char *merge;
if (git_config_get_string(&remote, config, remoteKey) == GIT_OK