summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2022-01-05 09:22:38 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2022-01-05 09:22:38 -0500
commit715bfe1048d740b8fa01a9f8534d81a8f65a228d (patch)
treea911eabdd4b365aab84a4507b75c7470c62b423d
parent83a1e614fa4435d8708792202e4f2f2c0b3ce51f (diff)
downloadlibgit2-ethomson/includeif.tar.gz
config: test allocation in config conditionalsethomson/includeif
-rw-r--r--src/config_file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/config_file.c b/src/config_file.c
index 91446df09..43a6ba440 100644
--- a/src/config_file.c
+++ b/src/config_file.c
@@ -740,7 +740,9 @@ static int parse_conditional_include(config_file_parse_data *parse_data, const c
return 0;
condition = git__substrdup(section + CONST_STRLEN("includeIf."),
- section_len - CONST_STRLEN("includeIf.") - CONST_STRLEN(".path"));
+ section_len - CONST_STRLEN("includeIf.") - CONST_STRLEN(".path"));
+
+ GIT_ERROR_CHECK_ALLOC(condition);
for (i = 0; i < ARRAY_SIZE(conditions); i++) {
if (git__prefixcmp(condition, conditions[i].prefix))