mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Prevent repository config from leaking
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user