Skip to content

Commit

Permalink
Check for OOM
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesg committed Dec 30, 2014
1 parent 0beb7fe commit dfda1cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/crlf.c
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
2 changes: 2 additions & 0 deletions src/ident.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit dfda1cf

Please sign in to comment.