aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/auth/secstore/util.c
blob: ebbb12df8745f412311704ab7ad1fcecc0be741e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <u.h>
#include <libc.h>

void *
emalloc(ulong n)
{
	void *p = malloc(n);
	if(p == nil)
		sysfatal("emalloc");
	memset(p, 0, n);
	return p;
}

void *
erealloc(void *p, ulong n)
{
	if ((p = realloc(p, n)) == nil)
		sysfatal("erealloc");
	return p;
}

char *
estrdup(char *s)
{
	if ((s = strdup(s)) == nil)
		sysfatal("estrdup");
	return s;
}