-static void pairs_free(pairs_st *pairs)
-{
- unsigned int x;
-
- for (x= 0; x < opt_default_pairs; x++)
- {
- free(pairs[x].key);
- free(pairs[x].value);
- }
-
- free(pairs);
-}
-
-static pairs_st *pairs_generate(void)
-{
- unsigned int x;
- pairs_st *pairs;
-
- pairs= (pairs_st*)malloc(sizeof(pairs_st) * opt_default_pairs);
-
- if (!pairs)
- goto error;
-
- for (x= 0; x < opt_default_pairs; x++)
- {
- pairs[x].key= (char *)malloc(sizeof(char) * 100);
- if (!pairs[x].key)
- goto error;
- get_random_string(pairs[x].key, 100);
- pairs[x].key_length= 100;
-
- pairs[x].value= (char *)malloc(sizeof(char) * 400);
- if (!pairs[x].value)
- goto error;
- get_random_string(pairs[x].value, 400);
- pairs[x].value_length= 400;
- }
-
- return pairs;
-error:
- fprintf(stderr, "Memory Allocation failure in pairs_generate.\n");
- exit(0);
-}
-