]> git.proxmox.com Git - libgit2.git/commitdiff
Check for OOM
authorJacques Germishuys <jacquesg@striata.com>
Sat, 27 Dec 2014 19:04:28 +0000 (21:04 +0200)
committerJacques Germishuys <jacquesg@striata.com>
Tue, 30 Dec 2014 10:33:40 +0000 (12:33 +0200)
src/crlf.c
src/ident.c

index 93448760da998d848e0959a9ddddc8476356e352..c0a73990fbace499493f9b8034759d925859f436 100644 (file)
@@ -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";
index 51630879dc76939e571fb2b3866db6cccd422d55..6bc80abc7b9b648c52dc0359228d03e765ac6a4e 100644 (file)
@@ -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 */