diff --git a/src/crlf.c b/src/crlf.c index 93448760d..c0a73990f 100644 --- a/src/crlf.c +++ b/src/crlf.c @@ -345,6 +345,8 @@ static void crlf_cleanup( git_filter *git_crlf_filter_new(void) { struct crlf_filter *f = git__calloc(1, sizeof(struct crlf_filter)); + if (f == NULL) + return NULL; f->f.version = GIT_FILTER_VERSION; f->f.attributes = "crlf eol text"; diff --git a/src/ident.c b/src/ident.c index 51630879d..6bc80abc7 100644 --- a/src/ident.c +++ b/src/ident.c @@ -115,6 +115,8 @@ static int ident_apply( git_filter *git_ident_filter_new(void) { git_filter *f = git__calloc(1, sizeof(git_filter)); + if (f == NULL) + return NULL; f->version = GIT_FILTER_VERSION; f->attributes = "+ident"; /* apply to files with ident attribute set */