fix memory allocation error
This commit is contained in:
@@ -102,8 +102,9 @@ void rxAddInput( struct complex16 *input_sig, struct complex16 *after_channel_si
|
||||
} //l
|
||||
}
|
||||
|
||||
out_ptr->r += round(rx_tmp.x*pathLossLinear + noise_per_sample*gaussZiggurat(0.0,1.0));
|
||||
out_ptr->i += round(rx_tmp.y*pathLossLinear + noise_per_sample*gaussZiggurat(0.0,1.0));
|
||||
// Fixme: lround(), rount(), ... is detected by valgrind as error, not found why
|
||||
out_ptr->r += lround(rx_tmp.x*pathLossLinear + noise_per_sample*gaussZiggurat(0.0,1.0));
|
||||
out_ptr->i += lround(rx_tmp.y*pathLossLinear + noise_per_sample*gaussZiggurat(0.0,1.0));
|
||||
out_ptr++;
|
||||
}
|
||||
|
||||
|
||||
@@ -1239,7 +1239,8 @@ void init_eNB(int single_thread_flag,
|
||||
if (RC.eNB[inst] == NULL) RC.eNB[inst] = (PHY_VARS_eNB **) malloc(RC.nb_CC[inst]*sizeof(PHY_VARS_eNB *));
|
||||
|
||||
for (CC_id=0; CC_id<RC.nb_L1_CC[inst]; CC_id++) {
|
||||
if (RC.eNB[inst][CC_id] == NULL) RC.eNB[inst][CC_id] = (PHY_VARS_eNB *) malloc(sizeof(PHY_VARS_eNB));
|
||||
if (RC.eNB[inst][CC_id] == NULL)
|
||||
RC.eNB[inst][CC_id] = (PHY_VARS_eNB *) calloc(1,sizeof(PHY_VARS_eNB));
|
||||
|
||||
eNB = RC.eNB[inst][CC_id];
|
||||
eNB->abstraction_flag = 0;
|
||||
|
||||
Reference in New Issue
Block a user