Commit 29016513 authored by Maria Haney's avatar Maria Haney
Browse files

Merge branch 'NRSur7dq4_MemoryLeakFix' into 'master'

NRSur7dq4: Fix memory leak when omega0 is too low

See merge request lscsoft/lalsuite!1404
parents e0f964bb 9ff98f74
......@@ -1858,7 +1858,10 @@ static PrecessingNRSurData* PrecessingNRSur_core(
int ret = PrecessingNRSur_IntegrateDynamics(dynamics_data, q, chiA0, chiB0,
omega_ref, init_orbphase, init_quat, LALparams,
__sur_data->PrecessingNRSurVersion);
if(ret != XLAL_SUCCESS) XLAL_ERROR_NULL(XLAL_FAILURE, "Failed to integrate dynamics");
if(ret != XLAL_SUCCESS) {
XLALFree(dynamics_data);
XLAL_ERROR_NULL(XLAL_FAILURE, "Failed to integrate dynamics");
}
// Put output into appropriate vectors
int i, j;
......@@ -2176,6 +2179,7 @@ int XLALSimInspiralPrecessingNRSurPolarizations(
int ret = get_dimless_omega(&omegaMin_dimless, &omegaRef_dimless,
fMin, fRef, Mtot_sec);
if(ret != XLAL_SUCCESS) {
if(ModeArray) XLALDestroyValue(ModeArray);
XLAL_ERROR(XLAL_EFUNC, "Failed to process fMin/fRef");
}
......@@ -2199,6 +2203,7 @@ int XLALSimInspiralPrecessingNRSurPolarizations(
ModeArray, LALparams, approximant);
if (!h_inertial_modes) {
if(ModeArray) XLALDestroyValue(ModeArray);
return XLAL_FAILURE;
}
......@@ -2435,6 +2440,7 @@ SphHarmTimeSeries *XLALSimInspiralPrecessingNRSurModes(
int ret = get_dimless_omega(&omegaMin_dimless, &omegaRef_dimless,
fMin, fRef, Mtot_sec);
if(ret != XLAL_SUCCESS) {
if(ModeArray) XLALDestroyValue(ModeArray);
XLAL_ERROR_NULL(XLAL_EFUNC, "Failed to process fMin/fRef");
}
......@@ -2457,6 +2463,7 @@ SphHarmTimeSeries *XLALSimInspiralPrecessingNRSurModes(
chiA0, chiB0, omegaRef_dimless, init_orbphase, init_quat,
ModeArray, LALparams, approximant);
if (!h_inertial) {
if(ModeArray) XLALDestroyValue(ModeArray);
XLAL_PRINT_INFO("PrecessingNRSur_core failed!");
return hlms;
}
......@@ -2713,6 +2720,7 @@ int XLALPrecessingNRSurDynamics(
chiA0, chiB0, omegaRef_dimless, init_orbphase, init_quat,
LALparams, __sur_data->PrecessingNRSurVersion);
if(ret != XLAL_SUCCESS) {
XLALFree(dynamics_data);
XLAL_ERROR(XLAL_FAILURE, "Failed to integrate dynamics");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment