Fix RGBLINK leaking partial string at EOF

Does not really do much, but silences some static analyzers
This commit is contained in:
ISSOtm
2022-06-12 16:39:55 +02:00
parent f5ac268989
commit 685ea5feed

View File

@@ -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;