diff options
author | tlatorre <tlatorre@uchicago.edu> | 2020-02-10 09:35:22 -0600 |
---|---|---|
committer | tlatorre <tlatorre@uchicago.edu> | 2020-02-10 09:35:22 -0600 |
commit | a2b3a8097c5ac3e2e74af2e10e75f6aa571990a8 (patch) | |
tree | 4d2b286e4fd574b073901cf5ed3fe9e2b9b68121 | |
parent | bccf9e927ab13ffaae639e6d93a56c0e7f3cacd3 (diff) | |
download | sddm-a2b3a8097c5ac3e2e74af2e10e75f6aa571990a8.tar.gz sddm-a2b3a8097c5ac3e2e74af2e10e75f6aa571990a8.tar.bz2 sddm-a2b3a8097c5ac3e2e74af2e10e75f6aa571990a8.zip |
fix small memory leak in get_expected_photons()
-rw-r--r-- | src/fit.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -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; |