commtech: avoid a double free corruption
Remove srand and rand function call as they generates double free corruption (???)
This commit is contained in:
parent
e90348b54c
commit
243d8810f1
|
@ -1,14 +1,14 @@
|
|||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
|
||||
static int nb_loop = 0, prod = 0, *prod_ptr = ∏
|
||||
unsigned int seedp;
|
||||
|
||||
int init_calc(int param_nb_loop)
|
||||
{
|
||||
nb_loop = param_nb_loop;
|
||||
srand((unsigned int) time(NULL));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ void **do_calc(void)
|
|||
int i;
|
||||
|
||||
for(i = 0; i < nb_loop; i++)
|
||||
prod += rand();
|
||||
prod += 42;
|
||||
return (void **) &prod_ptr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue