mirror of
https://github.com/AuxXxilium/kmod.git
synced 2025-01-27 09:15:01 +07:00
libkmod-util: getline_wrapped: return NULL when buffer allocation fails
This commit is contained in:
parent
40ee8dadca
commit
1698456259
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user