Skip to content

Commit

Permalink
Fix a subtle memory leak that was introduced with #46.
Browse files Browse the repository at this point in the history
The current I->a is simply overwritten, lp_value_assign takes care of properly destructing it before reassigning.
  • Loading branch information
nafur committed Jun 8, 2021
1 parent 21378b5 commit f543721
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/interval/interval.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f543721

Please sign in to comment.