Commit 4e2d1450 authored by Maria Haney's avatar Maria Haney
Browse files

Merge branch 'fix-phm-laldict' into 'master'

ensure default lalpars for phenomHM

See merge request lscsoft/lalsuite!721
parents b1f2be0c e75c1468
Pipeline #56295 passed with stages
in 84 minutes and 26 seconds
......@@ -914,6 +914,11 @@ int IMRPhenomDSetupAmpAndPhaseCoefficients(
LALDict *extraParams)
{
// Make a pointer to LALDict to circumvent a memory leak
// At the end we will check if we created a LALDict in extraParams
// and destroy it if we did.
LALDict *extraParams_in = extraParams;
/* It's difficult to see in the code but you need to setup the
* powers_of_pi.
*/
......@@ -992,6 +997,14 @@ int IMRPhenomDSetupAmpAndPhaseCoefficients(
LALFree(pPhi);
LALFree(pAmp);
/* If extraParams was allocated in this function and not passed in
* we need to free it to prevent a leak */
if (extraParams && !extraParams_in) {
XLALDestroyDict(extraParams);
} else {
XLALSimInspiralWaveformParamsInsertPNSpinOrder(extraParams,LAL_SIM_INSPIRAL_SPIN_ORDER_ALL);
}
return XLAL_SUCCESS;
}
......
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