aboutsummaryrefslogtreecommitdiff
path: root/src/lib9/mallocz.c
blob: a3e91510b17797b6b4287f44a601d1fc43c6806d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#include <u.h>
#include <unistd.h>
#include <string.h>
#include <libc.h>

void*
mallocz(unsigned long n, int clr)
{
	void *v;

	v = malloc(n);
	if(clr && v)
		memset(v, 0, n);
	return v;
}