Commit 9a5d17d9 authored by Cedric Roux's avatar Cedric Roux

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.
parent 9535e7a2
......@@ -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];
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment