From dfda1cf507f91b53e73345c9053f6a61587db984 Mon Sep 17 00:00:00 2001 From: Jacques Germishuys Date: Sat, 27 Dec 2014 21:04:28 +0200 Subject: Check for OOM --- src/crlf.c | 2 ++ src/ident.c | 2 ++ 2 files changed, 4 insertions(+) (limited to 'src') 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 */ -- cgit v1.2.1