Use calloc(3) instead of rolling our own.
This commit is contained in:
parent
a9648779a5
commit
d0b8d0fdfc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=87181
@ -38,10 +38,9 @@ zmalloc(size_t size)
|
||||
{
|
||||
void *ptr;
|
||||
|
||||
ptr = malloc(size);
|
||||
ptr = calloc(1, size);
|
||||
if (!ptr)
|
||||
err(EX_OSERR, "malloc() failed");
|
||||
bzero(ptr, size);
|
||||
|
||||
return ptr;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user