]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
libkmod-util: getline_wrapped: return NULL when buffer allocation fails
authorLeandro Pereira <leandro@profusion.mobi>
Wed, 28 Dec 2011 16:44:35 +0000 (14:44 -0200)
committerLucas De Marchi <lucas.demarchi@profusion.mobi>
Wed, 28 Dec 2011 17:55:45 +0000 (15:55 -0200)
libkmod/libkmod-util.c

index 95d5fba1669608f6c823ecdb95693398e24a819c..d402cdda591334ceabc9ae6526c6a38267d4183d 100644 (file)
@@ -47,6 +47,9 @@ char *getline_wrapped(FILE *fp, unsigned int *linenum)
        int i = 0;
        char *buf = malloc(size);
 
+       if (buf == NULL)
+               return NULL;
+
        for(;;) {
                int ch = getc_unlocked(fp);