Skip to content

Commit e733001

Browse files
committed
diff_parse: check return value of git_diff_init_options
1 parent 723bdf4 commit e733001

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/diff_parse.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ static git_diff_parsed *diff_parsed_alloc(void)
4444
diff->base.patch_fn = git_patch_parsed_from_diff;
4545
diff->base.free_fn = diff_parsed_free;
4646

47-
git_diff_init_options(&diff->base.opts, GIT_DIFF_OPTIONS_VERSION);
47+
if (git_diff_init_options(&diff->base.opts, GIT_DIFF_OPTIONS_VERSION) < 0) {
48+
git__free(&diff);
49+
return NULL;
50+
}
51+
4852
diff->base.opts.flags &= ~GIT_DIFF_IGNORE_CASE;
4953

5054
git_pool_init(&diff->base.pool, 1);

0 commit comments

Comments
 (0)