From d62441c3e3e78e802ada1fc3c027fe291bf9a99e Mon Sep 17 00:00:00 2001 From: Maximilian Muecke Date: Mon, 15 Jun 2026 15:37:04 +0200 Subject: [PATCH] fix: free d on early return in CO_Embed2_Dist_tau_d_expfit_meandiff --- C/CO_AutoCorr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/C/CO_AutoCorr.c b/C/CO_AutoCorr.c index 2b0511915..33832a4e2 100644 --- a/C/CO_AutoCorr.c +++ b/C/CO_AutoCorr.c @@ -291,6 +291,7 @@ double CO_Embed2_Dist_tau_d_expfit_meandiff(const double y[], const int size) int nBins = num_bins_auto(d, size-tau-1); if (nBins == 0){ + free(d); return 0; } int * histCounts = malloc(nBins * sizeof(double));