mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
Fix RGBLINK leaking partial string at EOF
Does not really do much, but silences some static analyzers
This commit is contained in:
@@ -151,8 +151,10 @@ static char *readstr(FILE *file)
|
||||
/* Read char */
|
||||
int byte = getc(file);
|
||||
|
||||
if (byte == EOF)
|
||||
if (byte == EOF) {
|
||||
free(str);
|
||||
return NULL;
|
||||
}
|
||||
str[index] = byte;
|
||||
} while (str[index]);
|
||||
return str;
|
||||
|
||||
Reference in New Issue
Block a user