Commit 9c40260043e8f146642ae54fc0e6bae2a76f9f79

Edward Thomson 2019-04-16T18:17:56

Merge pull request #5053 from tniessen/cf-check-array-alloc-result config_file: check result of git_array_alloc

1
2
3
4
5
6
7
8
9
10
11
12
diff --git a/src/config_file.c b/src/config_file.c
index 26c9e5e..7f8dd65 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -678,6 +678,7 @@ static int parse_include(git_config_parser *reader,
 		return result;
 
 	include = git_array_alloc(reader->file->includes);
+	GIT_ERROR_CHECK_ALLOC(include);
 	memset(include, 0, sizeof(*include));
 	git_array_init(include->includes);
 	include->path = git_buf_detach(&path);