// allocate memory for out of place bucket_sort\r
bucket_array_t bucket;\r
\r
- if ( !bucket_malloc(bucket) ) goto out;\r
+ for (uint32_t i = 0; i < 2; i++) {\r
+ for (uint32_t j = 0; j <= 0xff; j++) {\r
+ bucket[i][j].head = malloc(sizeof(uint32_t)<<14);\r
+ if (!bucket[i][j].head) {\r
+ goto out;\r
+ }\r
+ }\r
+ }\r
\r
// initialize statelists: add all possible states which would result into the rightmost 2 bits of the keystream\r
for(i = 1 << 20; i >= 0; --i) {\r
out:\r
free(odd_head);\r
free(even_head);\r
- bucket_free(bucket);\r
+ for (uint8_t i = 0; i < 2; i++)\r
+ for (uint8_t j = 0; j <= 0xff; j++)\r
+ free(bucket[i][j].head);\r
return statelist;\r
}\r
\r