From 03e19ff241bc0aeb8cae6129eebfce71633a438a Mon Sep 17 00:00:00 2001 From: Christian Giese Date: Fri, 16 Jun 2023 14:15:30 +0000 Subject: [PATCH] fix minor valgrind issues --- code/bngblaster/src/bbl_protocols.c | 2 +- code/bngblaster/src/bbl_txq.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/code/bngblaster/src/bbl_protocols.c b/code/bngblaster/src/bbl_protocols.c index c8c997aa..f7df506c 100644 --- a/code/bngblaster/src/bbl_protocols.c +++ b/code/bngblaster/src/bbl_protocols.c @@ -59,7 +59,7 @@ _checksum(void *buf, ssize_t len) static uint32_t _fold(uint32_t sum) { - while (sum >> 16) { + while(sum >> 16) { sum = (sum & 0xffff) + (sum >> 16); } return sum; diff --git a/code/bngblaster/src/bbl_txq.c b/code/bngblaster/src/bbl_txq.c index a78dc676..13ce2d83 100644 --- a/code/bngblaster/src/bbl_txq.c +++ b/code/bngblaster/src/bbl_txq.c @@ -13,7 +13,7 @@ bool bbl_txq_init(bbl_txq_s *txq, uint16_t size) { - txq->ring = malloc(size * sizeof(bbl_txq_slot_t)); + txq->ring = calloc(1, size * sizeof(bbl_txq_slot_t)); if(!txq->ring) { return false; }