Check for OOM

This commit is contained in:
Jacques Germishuys 2014-12-27 21:04:28 +02:00
parent 0beb7fe427
commit dfda1cf507
2 changed files with 4 additions and 0 deletions

View File

@ -345,6 +345,8 @@ static void crlf_cleanup(
git_filter *git_crlf_filter_new(void) git_filter *git_crlf_filter_new(void)
{ {
struct crlf_filter *f = git__calloc(1, sizeof(struct crlf_filter)); struct crlf_filter *f = git__calloc(1, sizeof(struct crlf_filter));
if (f == NULL)
return NULL;
f->f.version = GIT_FILTER_VERSION; f->f.version = GIT_FILTER_VERSION;
f->f.attributes = "crlf eol text"; f->f.attributes = "crlf eol text";

View File

@ -115,6 +115,8 @@ static int ident_apply(
git_filter *git_ident_filter_new(void) git_filter *git_ident_filter_new(void)
{ {
git_filter *f = git__calloc(1, sizeof(git_filter)); git_filter *f = git__calloc(1, sizeof(git_filter));
if (f == NULL)
return NULL;
f->version = GIT_FILTER_VERSION; f->version = GIT_FILTER_VERSION;
f->attributes = "+ident"; /* apply to files with ident attribute set */ f->attributes = "+ident"; /* apply to files with ident attribute set */