Skip to content

Commit f543721

Browse files
committed
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.
1 parent 21378b5 commit f543721

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/interval/interval.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -823,7 +823,7 @@ void lp_interval_set_a(lp_interval_t* I, const lp_value_t* a, int a_open) {
823823
assert(cmp <= 0);
824824
if (cmp < 0) {
825825
lp_value_construct_copy(&I->b, &I->a);
826-
lp_value_construct_copy(&I->a, a);
826+
lp_value_assign(&I->a, a);
827827
I->is_point = 0;
828828
I->a_open = a_open;
829829
I->b_open = 0;

0 commit comments

Comments
 (0)