Check malloc error
This commit is contained in:
parent
8b78baa587
commit
3a0541e5fa
10
emu.c
10
emu.c
@ -603,7 +603,15 @@ emu_destroy(struct ovni_emu *emu)
|
||||
int
|
||||
main(int argc, char *argv[])
|
||||
{
|
||||
struct ovni_emu *emu = (struct ovni_emu *) malloc(sizeof(struct ovni_emu));
|
||||
struct ovni_emu *emu;
|
||||
|
||||
emu = malloc(sizeof(struct ovni_emu));
|
||||
|
||||
if(emu == NULL)
|
||||
{
|
||||
perror("malloc");
|
||||
return 1;
|
||||
}
|
||||
|
||||
emu_init(emu, argc, argv);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user