I tried using the tutorial given at http://wiki.originlab.com/~originla/howto/index.php?title=Tutorial:Fitting_with_Integral_using_NAG_Library and it gave me the following error: ................. compiling... _nlfnag_integration_fitting.fit C:\..\NLSF\_nlfnag_integration_fitting.fit(108) :Error, function or variable NAG_FREE not found C:\..\NLSF\_nlfnag_integration_fitting.fit(108) :Error, general compile error C:\..\NLSF\_nlfnag_integration_fitting.fit(106) :Error, general compile error C:\..\NLSF\_nlfnag_integration_fitting.fit(54) :Error, error(s) found in compiling function _nlsfnag_integration_fitting Compile Failed! .............. I than included the line '#define NAG_FREE(X) x04bdc((Pointer *)&(X))' below the '#include <origin.h>' and recompiled again and the problem was solved.i.e, compilation was successful. Now my question is : Given that I don't want to upgrade to the next service pack available, and if I include the above mentioned code line in all the subsequent codes,can I be assured that the memory allocation is freed before calling the integration routine again to avoid memory leakage ?