1
0
mirror of https://github.com/pevans/erc-c.git synced 2025-02-17 07:32:05 +00:00

Initialize cpu as NULL

Static analysis in clang caught this; we might try to free memory from a
garbage pointer value if the main segment malloc fails.
This commit is contained in:
Peter Evans 2018-01-11 13:25:22 -06:00
parent 9d2f9b6f60
commit a17ad0596b

View File

@ -45,6 +45,7 @@ apple2_create(int width, int height)
// Forward set these to NULL in case we fail to build the machine
// properly; that way, we won't try to free garbage data
mach->rom = NULL;
mach->cpu = NULL;
mach->aux = NULL;
mach->main = NULL;
mach->sysfont = NULL;