Fix somememory leaks

master
Xavier Arteaga 5 years ago committed by Xavier Arteaga
parent e6792cf9b7
commit a7525d3e12

@ -257,6 +257,8 @@ int srslte_ofdm_rx_init(srslte_ofdm_t* q, srslte_cp_t cp, cf_t* in_buffer, cf_t*
int srslte_ofdm_rx_init_mbsfn(srslte_ofdm_t* q, srslte_cp_t cp, cf_t* in_buffer, cf_t* out_buffer, uint32_t max_prb)
{
bzero(q, sizeof(srslte_ofdm_t));
srslte_ofdm_cfg_t cfg = {};
cfg.cp = cp;
cfg.in_buffer = in_buffer;
@ -283,16 +285,22 @@ int srslte_ofdm_tx_init(srslte_ofdm_t* q, srslte_cp_t cp, cf_t* in_buffer, cf_t*
int srslte_ofdm_tx_init_cfg(srslte_ofdm_t* q, srslte_ofdm_cfg_t* cfg)
{
bzero(q, sizeof(srslte_ofdm_t));
return ofdm_init_mbsfn_(q, cfg, SRSLTE_DFT_BACKWARD);
}
int srslte_ofdm_rx_init_cfg(srslte_ofdm_t* q, srslte_ofdm_cfg_t* cfg)
{
bzero(q, sizeof(srslte_ofdm_t));
return ofdm_init_mbsfn_(q, cfg, SRSLTE_DFT_FORWARD);
}
int srslte_ofdm_tx_init_mbsfn(srslte_ofdm_t* q, srslte_cp_t cp, cf_t* in_buffer, cf_t* out_buffer, uint32_t nof_prb)
{
bzero(q, sizeof(srslte_ofdm_t));
srslte_ofdm_cfg_t cfg = {};
cfg.cp = cp;
cfg.in_buffer = in_buffer;

@ -50,7 +50,7 @@ uint32_t sf_idx = 1;
uint8_t non_mbsfn_region = 2;
int mbsfn_area_id = 1;
srslte_softbuffer_rx_t softbuffer_rx;
srslte_softbuffer_rx_t softbuffer_rx = {};
srslte_filesource_t fsrc;
srslte_ue_dl_t ue_dl;
cf_t* input_buffer[SRSLTE_MAX_PORTS];
@ -80,7 +80,7 @@ void parse_args(int argc, char** argv)
cell.id = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 's':
sf_idx = (int)strtol(argv[optind], NULL, 10);
sf_idx = (uint32_t)strtol(argv[optind], NULL, 10);
break;
case 'f':
cfi = (uint32_t)strtol(argv[optind], NULL, 10);
@ -151,6 +151,7 @@ void base_free()
{
srslte_filesource_free(&fsrc);
srslte_ue_dl_free(&ue_dl);
srslte_softbuffer_rx_free(&softbuffer_rx);
free(input_buffer[0]);
}

Loading…
Cancel
Save