xref: /freebsd/sbin/ipf/libipf/allocmbt.c (revision 44bc30192139b0b3c95510ab3b35802bcc6d63e4)
141edb306SCy Schubert /*
241edb306SCy Schubert  * Copyright (C) 2012 by Darren Reed.
341edb306SCy Schubert  *
441edb306SCy Schubert  * See the IPFILTER.LICENCE file for details on licencing.
541edb306SCy Schubert  *
641edb306SCy Schubert  * $Id: allocmbt.c,v 1.1.4.1 2012/07/22 08:04:24 darren_r Exp $
741edb306SCy Schubert  */
841edb306SCy Schubert 
941edb306SCy Schubert #include "ipf.h"
1041edb306SCy Schubert 
11efeb8bffSCy Schubert mb_t *
allocmbt(size_t len)12efeb8bffSCy Schubert allocmbt(size_t len)
1341edb306SCy Schubert {
1441edb306SCy Schubert 	mb_t *m;
1541edb306SCy Schubert 
1641edb306SCy Schubert 	m = (mb_t *)malloc(sizeof(mb_t));
1741edb306SCy Schubert 	if (m == NULL)
18*2582ae57SCy Schubert 		return (NULL);
1941edb306SCy Schubert 	m->mb_len = len;
2041edb306SCy Schubert 	m->mb_next = NULL;
2141edb306SCy Schubert 	m->mb_data = (char *)m->mb_buf;
22*2582ae57SCy Schubert 	return (m);
2341edb306SCy Schubert }
24