Commit 9f1b54d6d01bb25c06b2e9d86db922616e2bb566

Carlos Martín Nieto 2011-04-04T15:07:47

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>

1
2
3
4
5
6
7
8
9
10
11
12
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;