free allocated memory for setting up the interpolation in C