From f543721215ec17a724dc86820a0430233931a637 Mon Sep 17 00:00:00 2001 From: Gereon Kremer Date: Tue, 8 Jun 2021 15:28:03 +0200 Subject: [PATCH] Fix a subtle memory leak that was introduced with #46. The current I->a is simply overwritten, lp_value_assign takes care of properly destructing it before reassigning. --- src/interval/interval.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/interval/interval.c b/src/interval/interval.c index 05400f7b..d246cb1a 100644 --- a/src/interval/interval.c +++ b/src/interval/interval.c @@ -823,7 +823,7 @@ void lp_interval_set_a(lp_interval_t* I, const lp_value_t* a, int a_open) { assert(cmp <= 0); if (cmp < 0) { lp_value_construct_copy(&I->b, &I->a); - lp_value_construct_copy(&I->a, a); + lp_value_assign(&I->a, a); I->is_point = 0; I->a_open = a_open; I->b_open = 0;