@@ -1127,16 +1127,19 @@ bool test_mac_mlme_beacon_notify()
11271127 memset (& setup , 0 , sizeof (protocol_interface_rf_mac_setup_s ));
11281128 setup .tun_extension_rf_driver = NULL ;
11291129 mlme_beacon_ind_t data ;
1130+ memset (& data , 0 , sizeof (mlme_beacon_ind_t ));
11301131 mac_api_t api ;
1132+ memset (& api , 0 , sizeof (mac_api_t ));
11311133 api .mlme_ind_cb = & mlme_ind_callback ;
11321134 sw_mac_stub .mac_api_ptr = & api ;
11331135 mlme_scan_conf_t conf ;
1136+ memset (& conf , 0 , sizeof (mlme_scan_conf_t ));
11341137 setup .mac_mlme_scan_resp = & conf ;
11351138
11361139 //Test add_or_update_beacon here completely -->
11371140 mlme_pan_descriptor_t desc1 ;
1141+ memset (& desc1 , 0 , sizeof (mlme_pan_descriptor_t ));
11381142 conf .PAN_values [0 ] = & desc1 ;
1139- conf .PAN_values [1 ] = NULL ;
11401143 conf .ResultListSize = 2 ;
11411144 desc1 .LogicalChannel = 11 ;
11421145 data .PANDescriptor .LogicalChannel = 11 ;
@@ -1147,11 +1150,13 @@ bool test_mac_mlme_beacon_notify()
11471150 // Beacon data length doesn't contain FHSS synch info on single channel
11481151 data .beacon_data_length = FHSS_SYNCH_INFO_START ;
11491152
1153+ nsdynmemlib_stub .returnCounter = 0 ;
11501154 //for loop covered here
11511155 if (0 != mac_mlme_beacon_notify (& setup , & data )){
11521156 return false;
11531157 }
11541158
1159+ //Add First
11551160 conf .PAN_values [0 ] = NULL ;
11561161 if (0 != mac_mlme_beacon_notify (& setup , & data )){
11571162 return false;
@@ -1170,6 +1175,8 @@ bool test_mac_mlme_beacon_notify()
11701175 }
11711176
11721177 ns_dyn_mem_free (conf .PAN_values [2 ]);
1178+ conf .PAN_values [2 ] = NULL ;
1179+ conf .ResultListSize = 2 ;
11731180
11741181 // FHSS TESTS START
11751182 setup .fhss_api = ns_fhss_create (0 , 0 );
0 commit comments