config: also free the file buffer on error

On error, the buffer containing the file contents also needs to be
freed.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
This commit is contained in:
Carlos Martín Nieto 2011-04-04 15:07:47 +02:00
parent fe116e261f
commit 9f1b54d6d0

View File

@ -210,6 +210,7 @@ int git_config_open(git_config **cfg_out, const char *path)
cvar_list_free(cfg->vars);
if(cfg->file_path)
free(cfg->file_path);
gitfo_free_buf(&cfg->reader.buffer);
free(cfg);
return error;