Commit 584f8eed authored by Leo Pound Singer's avatar Leo Pound Singer

Fix potential memory leak in error handling

Original: 72f502cdf7e1b4da4ce13c0dd01fff7d7db93dc3
parent 5bb7fb2d
......@@ -846,7 +846,11 @@ bayestar_pixel *bayestar_sky_map_toa_phoa_snr(
/* Adaptively refine the pixels that contain the most probability. */
pixels = bayestar_pixels_refine(pixels, &len, npix0 / 4);
if (!pixels)
{
for (unsigned char k = 0; k < 3; k ++)
log_radial_integrator_free(integrators[k]);
return NULL;
}
#pragma omp parallel for
for (unsigned long i = len - npix0; i < len; i ++)
......
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