mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 18:22:07 +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 */
|
/* Read char */
|
||||||
int byte = getc(file);
|
int byte = getc(file);
|
||||||
|
|
||||||
if (byte == EOF)
|
if (byte == EOF) {
|
||||||
|
free(str);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
str[index] = byte;
|
str[index] = byte;
|
||||||
} while (str[index]);
|
} while (str[index]);
|
||||||
return str;
|
return str;
|
||||||
|
|||||||
Reference in New Issue
Block a user