aboutsummaryrefslogtreecommitdiff
path: root/pcap-tc.c
diff options
context:
space:
mode:
Diffstat (limited to 'pcap-tc.c')
-rw-r--r--pcap-tc.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/pcap-tc.c b/pcap-tc.c
index f1f671d9..d01b5902 100644
--- a/pcap-tc.c
+++ b/pcap-tc.c
@@ -540,14 +540,14 @@ TcActivate(pcap_t *p)
p->linktype = DLT_EN10MB;
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_PPI;
- p->dlt_count = 2;
+ if (p->dlt_list == NULL)
+ {
+ snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "Error allocating memory");
+ return PCAP_ERROR;
}
+ p->dlt_list[0] = DLT_EN10MB;
+ p->dlt_list[1] = DLT_PPI;
+ p->dlt_count = 2;
/*
* ignore promiscuous mode