ralna / RALFit

A non-linear least squares solver
Other
25 stars 6 forks source link

Fix Memory leak in C interface #112

Closed talassio closed 3 months ago

talassio commented 3 months ago

There is an inverted if c_associated at freeing up the workspace memory in the C interface definitions. See, https://github.com/ralna/RALFit/blob/7102863e811db233935d75e7f278df8b3d049d1c/libRALFit/src/ral_nlls_ciface.f90#L560 Should be,

if( .not. c_associated(cw) return ! Nothing to do if not associated

Leak was verified using libASAN and Valgrind.