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:
parent
9d2f9b6f60
commit
a17ad0596b
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user