libkmod-util: getline_wrapped: return NULL when buffer allocation fails

This commit is contained in:
Leandro Pereira 2011-12-28 14:44:35 -02:00 committed by Lucas De Marchi
parent 40ee8dadca
commit 1698456259

View 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);