Skip to content

Commit

Permalink
Merge pull request #181 from ChinYikMing/master
Browse files Browse the repository at this point in the history
Fix return NULL when malloc failed
  • Loading branch information
jserv authored Aug 1, 2023
2 parents 3a468e6 + 2f14ce1 commit 687491c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ memory_t *memory_new()
return NULL;
#else
data_memory_base = malloc(MEM_SIZE);
if (data_memory_base)
if (!data_memory_base)
return NULL;
#endif
mem->mem_base = data_memory_base;
Expand Down

0 comments on commit 687491c

Please sign in to comment.