3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2026-05-02 00:23:44 +00:00

fix a memory leak

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2026-03-14 18:35:16 -10:00
parent b2b811749a
commit 6ee4714a5d

View file

@ -124,10 +124,12 @@ struct solver::imp {
den = lcm(den, denominator(coeff)); den = lcm(den, denominator(coeff));
for (auto const& [w, coeff] : lra.get_term(v)) { for (auto const& [w, coeff] : lra.get_term(v)) {
auto pw = definitions.get(w); auto pw = definitions.get(w);
polynomial::polynomial_ref term(pm);
term = pm.mul(den * coeff, pw);
if (!p) if (!p)
p = pm.mul(den * coeff, pw); p = term;
else else
p = pm.add(p, pm.mul(den * coeff, pw)); p = pm.add(p, term);
} }
} }
else { else {