/* Allocate data buffer. Returns -1 if memory allocation fails, else 0.  */
int pcap_alloc_databuf(pcap_t *p)
/* Allocate data buffer. Returns -1 if memory allocation fails, else 0.  */
int pcap_alloc_databuf(pcap_t *p)
{
	p->bufsize = PKTBUFSIZE;
	p->buffer = malloc(p->bufsize + p->offset);
	if (p->buffer == NULL) {
		pcap_fmt_errmsg_for_errno(p->errbuf, PCAP_ERRBUF_SIZE,
		    errno, "malloc");
		return (-1);
	}
	return (0);
}