summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--tun.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/tun.c b/tun.c
index 2b7f95b..9d46527 100644
--- a/tun.c
+++ b/tun.c
@@ -238,9 +238,7 @@ enum { PKT_DEBUG_ENABLED = 0 };
static packet_t *
alloc_packet(void)
{
- packet_t *pkt = malloc(sizeof(packet_t) + MIN_PKT_LEN);
- memset(pkt, 0, sizeof(*pkt));
- return pkt;
+ return (packet_t *) calloc(1, sizeof(packet_t) + MIN_PKT_LEN);
}
/* add packet to list */