Skip to content

Commit d6ef55c

Browse files
committed
Use calloc rather than malloc + memset
1 parent cc3ad52 commit d6ef55c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/riscv/i_system.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -255,10 +255,8 @@ I_Quit(void)
255255
byte *
256256
I_AllocLow(int length)
257257
{
258-
byte* mem;
259-
mem = (byte *)malloc (length);
260-
memset (mem,0,length);
261-
return mem;
258+
/* FIXME: check if memory allocation succeeds */
259+
return calloc(1, length);
262260
}
263261

264262

0 commit comments

Comments
 (0)