From 2281436b66a2fc424d5e24ae379d038ff03dd423 Mon Sep 17 00:00:00 2001
From: Parminder Singh <parminder.singh@iis.fraunhofer.de>
Date: Wed, 9 Sep 2020 11:11:24 +0200
Subject: [PATCH] Fix - Issue with uninitialized structure in ULSIM

- Changed malloc to calloc to set all values to zero to remove the
  valgrind issue with uninitialized structure values in RC.gNB structure
---
 openair1/SIMULATION/NR_PHY/ulsim.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/openair1/SIMULATION/NR_PHY/ulsim.c b/openair1/SIMULATION/NR_PHY/ulsim.c
index 2eea321f165..61fb9d5c237 100644
--- a/openair1/SIMULATION/NR_PHY/ulsim.c
+++ b/openair1/SIMULATION/NR_PHY/ulsim.c
@@ -494,7 +494,7 @@ int main(int argc, char **argv)
   UE2gNB->max_Doppler = maxDoppler;
 
   RC.gNB = (PHY_VARS_gNB **) malloc(sizeof(PHY_VARS_gNB *));
-  RC.gNB[0] = malloc(sizeof(PHY_VARS_gNB));
+  RC.gNB[0] = calloc(1,sizeof(PHY_VARS_gNB));
   gNB = RC.gNB[0];
   //gNB_config = &gNB->gNB_config;
 
-- 
GitLab