I've already located the bug. Was not in the curl library
I was in the use of variables and arrays with the same name.
So far everything worked correctly but when the program repeated many times the process .... failed due to lack of memory.
Example: (My program has more than 7k lines...)
Static_value [f] = random_value
Static_value = 3
^^ ---- Execution worked four times... and then (out of memory)
Solved renamed
Static_value [f] = random_value
my_Static_value = 3
Ty