From b7fc2299e5f38026fed0806f94982ddbd02d9c41 Mon Sep 17 00:00:00 2001 From: Xavier Arteaga Date: Thu, 19 Nov 2020 11:56:44 +0100 Subject: [PATCH] Softbuffers initialise buffer pointers with zero memory --- lib/src/phy/fec/softbuffer.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/src/phy/fec/softbuffer.c b/lib/src/phy/fec/softbuffer.c index 9cefc5dda..5b0e9a5f2 100644 --- a/lib/src/phy/fec/softbuffer.c +++ b/lib/src/phy/fec/softbuffer.c @@ -62,13 +62,13 @@ int srslte_softbuffer_rx_init_guru(srslte_softbuffer_rx_t* q, uint32_t max_cb, u q->max_cb = max_cb; q->max_cb_size = max_cb_size; - q->buffer_f = srslte_vec_malloc(sizeof(int16_t*) * q->max_cb); + q->buffer_f = calloc(sizeof(int16_t*), q->max_cb); if (!q->buffer_f) { perror("malloc"); goto clean_exit; } - q->data = srslte_vec_malloc(sizeof(uint8_t*) * q->max_cb); + q->data = calloc(sizeof(uint8_t*), q->max_cb); if (!q->data) { perror("malloc"); goto clean_exit; @@ -191,7 +191,7 @@ int srslte_softbuffer_tx_init_guru(srslte_softbuffer_tx_t* q, uint32_t max_cb, u q->max_cb = max_cb; q->max_cb_size = max_cb_size; - q->buffer_b = srslte_vec_malloc(sizeof(uint8_t*) * q->max_cb); + q->buffer_b = calloc(sizeof(uint8_t*), q->max_cb); if (!q->buffer_b) { perror("malloc"); return SRSLTE_ERROR;