mirror of
https://git.proxmox.com/git/libgit2
synced 2025-11-04 22:49:32 +00:00
config: free the file buffer earlier
There is no need to keep config file in memory until the the configuration is freed. Free the buffer immediately after the configuration has been parsed. Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
This commit is contained in:
parent
8bd6c0ab83
commit
956ad0ed6f
@ -200,6 +200,8 @@ int git_config_open(git_config **cfg_out, const char *path)
|
||||
else
|
||||
*cfg_out = cfg;
|
||||
|
||||
gitfo_free_buf(&cfg->reader.buffer);
|
||||
|
||||
return error;
|
||||
|
||||
cleanup:
|
||||
@ -220,7 +222,6 @@ void git_config_free(git_config *cfg)
|
||||
|
||||
free(cfg->file_path);
|
||||
cvar_list_free(cfg->vars);
|
||||
gitfo_free_buf(&cfg->reader.buffer);
|
||||
|
||||
free(cfg);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user