bugfix: do not allocate memory

Memory was allocated which was "lost" because the
address of the block was put in a pointer that is
overwritten just after.

Discussing with Elena, the current commit is the correct
way to do things.
This commit is contained in:
Cedric Roux
2017-02-16 15:37:56 +01:00
parent 9535e7a276
commit 9a5d17d967
+2 -1
View File
@@ -119,8 +119,9 @@ void fill_channel_desc(channel_desc_t *chan_desc,
else {
chan_desc->R_sqrt = (struct complex**) calloc(nb_taps,sizeof(struct complex*));
for (i = 0; i<nb_taps; i++) {
chan_desc->R_sqrt[i] = (struct complex*) calloc(nb_tx*nb_rx*nb_tx*nb_rx,sizeof(struct complex));
//chan_desc->R_sqrt[i] = (struct complex*) calloc(nb_tx*nb_rx*nb_tx*nb_rx,sizeof(struct complex));
//chan_desc->R_sqrt = (struct complex*)&R_sqrt[i][0];
/* all chan_desc share the same R_sqrt, coming from caller */
chan_desc->R_sqrt[i] = R_sqrt[0];
}
}