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>
diff --git a/src/config.c b/src/config.c
index 4aa0e36..a4bded9 100644
--- a/src/config.c
+++ b/src/config.c
@@ -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;