mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-07 16:22:40 +00:00
Fix a memory leak in config_parse
.
This commit is contained in:
parent
1234738e06
commit
a8e4cb11fd
@ -1072,8 +1072,10 @@ static int config_parse(diskfile_backend *cfg_file, struct reader *reader, git_c
|
||||
git_buf_printf(&buf, "%s.%s", current_section, var_name);
|
||||
git__free(var_name);
|
||||
|
||||
if (git_buf_oom(&buf))
|
||||
if (git_buf_oom(&buf)) {
|
||||
git__free(var_value);
|
||||
return -1;
|
||||
}
|
||||
|
||||
var->entry->name = git_buf_detach(&buf);
|
||||
var->entry->value = var_value;
|
||||
|
Loading…
Reference in New Issue
Block a user