Skip to content

Commit 715bfe1

Browse files
committed
config: test allocation in config conditionals
1 parent 83a1e61 commit 715bfe1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/config_file.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -740,7 +740,9 @@ static int parse_conditional_include(config_file_parse_data *parse_data, const c
740740
return 0;
741741

742742
condition = git__substrdup(section + CONST_STRLEN("includeIf."),
743-
section_len - CONST_STRLEN("includeIf.") - CONST_STRLEN(".path"));
743+
section_len - CONST_STRLEN("includeIf.") - CONST_STRLEN(".path"));
744+
745+
GIT_ERROR_CHECK_ALLOC(condition);
744746

745747
for (i = 0; i < ARRAY_SIZE(conditions); i++) {
746748
if (git__prefixcmp(condition, conditions[i].prefix))

0 commit comments

Comments
 (0)