aboutsummaryrefslogtreecommitdiff
path: root/pcap-pf.c
diff options
context:
space:
mode:
Diffstat (limited to 'pcap-pf.c')
-rw-r--r--pcap-pf.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/pcap-pf.c b/pcap-pf.c
index da08510d..2e231bec 100644
--- a/pcap-pf.c
+++ b/pcap-pf.c
@@ -404,14 +404,15 @@ pcap_activate_pf(pcap_t *p)
* Ethernet framing).
*/
p->dlt_list = (u_int *) malloc(sizeof(u_int) * 2);
- /*
- * If that fails, just leave the list empty.
- */
- if (p->dlt_list != NULL) {
- p->dlt_list[0] = DLT_EN10MB;
- p->dlt_list[1] = DLT_DOCSIS;
- p->dlt_count = 2;
+ if (p->dlt_list == NULL) {
+ pcap_fmt_errmsg_for_errno(p->errbuf, PCAP_ERRBUF_SIZE,
+ errno, "malloc");
+ err = PCAP_ERROR;
+ goto bad;
}
+ p->dlt_list[0] = DLT_EN10MB;
+ p->dlt_list[1] = DLT_DOCSIS;
+ p->dlt_count = 2;
break;
case ENDT_FDDI: