diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-08-18 01:19:36 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-08-18 01:19:36 +0300 |
| commit | f8c192f59a55db99fe088588b161a207b237b288 (patch) | |
| tree | 2b4d5a3679e02069ae9d8edb0d09edd9cd278f0d /triscv/src/mem.c | |
| parent | aa0665af307420e493b09af9a97fbd36fd53ef4b (diff) | |
| download | tri-f8c192f59a55db99fe088588b161a207b237b288.tar.gz tri-f8c192f59a55db99fe088588b161a207b237b288.zip | |
Diffstat (limited to 'triscv/src/mem.c')
| -rw-r--r-- | triscv/src/mem.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/triscv/src/mem.c b/triscv/src/mem.c index 9ce2a68..4aa936b 100644 --- a/triscv/src/mem.c +++ b/triscv/src/mem.c @@ -13,6 +13,9 @@ struct mem *mem_create(size_t size) struct mem *mem = calloc(1, sizeof(struct mem) + size * sizeof(mem->buf[0])); + if (!mem) + return NULL; + mem->size = size; return mem; } |
