From d949e35a7321d11b5167ad6cfbe8630ac7abe02f Mon Sep 17 00:00:00 2001 From: Sven Verdoolaege Date: Sat, 30 Jun 2007 17:04:30 +0200 Subject: [PATCH] barvinok_enumerate: plug memory leak in Bernoulli approximation --- barvinok.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/barvinok.cc b/barvinok.cc index 548e5ec..cfad4c4 100644 --- a/barvinok.cc +++ b/barvinok.cc @@ -1490,9 +1490,6 @@ static evalue* barvinok_enumerate_cst(Polyhedron *P, Polyhedron* C, static evalue* enumerate(Polyhedron *P, Polyhedron* C, struct barvinok_options *options) { - if (options->approximation_method == BV_APPROX_BERNOULLI) - return Bernoulli_sum(P, C, options); - //P = unfringe(P, MaxRays); Polyhedron *next; Polyhedron *Corig = C; @@ -1643,7 +1640,11 @@ evalue* barvinok_enumerate_with_options(Polyhedron *P, Polyhedron* C, Porig->next = next; Polyhedron_Free(CA); - eres = enumerate(P, C, options); + if (options->approximation_method == BV_APPROX_BERNOULLI) { + eres = Bernoulli_sum(P, C, options); + Domain_Free(P); + } else + eres = enumerate(P, C, options); C->next = Cnext; -- 2.11.4.GIT