aboutsummaryrefslogtreecommitdiff
path: root/src/fit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fit.c')
-rw-r--r--src/fit.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/fit.c b/src/fit.c
index a5d531a..0fa8766 100644
--- a/src/fit.c
+++ b/src/fit.c
@@ -5240,6 +5240,7 @@ double get_expected_photons(int id, double T0, double distance, double cos_theta
break;
default:
fprintf(stderr, "unknown particle id %i\n", id);
+ particle_free(p);
exit(1);
}
@@ -5255,6 +5256,8 @@ double get_expected_photons(int id, double T0, double distance, double cos_theta
nphotons += p->delta_ray_photons*distance/p->range*(1-interp1d(cos_theta,p->cos_theta,p->cdf_delta,p->n));
}
+ particle_free(p);
+
/* Finally we multiply by the average quantum efficiency and divide by 2 to
* account for the PMT coverage. */
return nphotons*get_weighted_quantum_efficiency()/2.0;