FreeBSD/sbin/hastd/nv.c
/*
 * Allocate and initialize new nv structure.
 * Return NULL in case of malloc(3) failure.
 */
Allocate and initialize new nv structure.
Return NULL in case of malloc(3) failure.
Allocate and initialize new nv structure . Return NULL in case of malloc ( 3 ) failure .
struct nv *
nv_alloc(void)
{
	struct nv *nv;
	nv = malloc(sizeof(*nv));
	if (nv == NULL)
		return (NULL);
	nv->nv_ebuf = ebuf_alloc(0);
	if (nv->nv_ebuf == NULL) {
		free(nv);
		return (NULL);
	}
	nv->nv_error = 0;
	nv->nv_magic = NV_MAGIC;
	return (nv);
}
struct nv * nv_alloc ( void ) { struct nv * nv ; nv = malloc ( sizeof ( * nv ) ) ; if ( nv == NULL ) return ( NULL ) ; nv -> nv_ebuf = ebuf_alloc ( 0 ) ; if ( nv -> nv_ebuf == NULL ) { free ( nv ) ; return ( NULL ) ; } nv -> nv_error = 0 ; nv -> nv_magic = NV_MAGIC ; return ( nv ) ; }
Allocate and initialize new nv structure.
Allocate and initialize new nv structure .