commtech: avoid a double free corruption

Remove srand and rand function call as they generates double free
corruption (???)
This commit is contained in:
Thomas Preud'homme 2009-07-01 01:49:16 +02:00 committed by Thomas Preud'homme
parent e90348b54c
commit 243d8810f1
1 changed files with 3 additions and 3 deletions

View File

@ -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 = &prod;
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;
}