lbtt: fix a memory leak detected by asan.

* spot/twaalgos/lbtt.cc: Here.
* NEWS: Mention it.
This commit is contained in:
Alexandre Duret-Lutz 2016-07-27 20:09:16 +02:00
parent a9fc5d49d8
commit 561672d3d7
2 changed files with 7 additions and 4 deletions

3
NEWS
View file

@ -195,6 +195,9 @@ New in spot 2.0.3a (not yet released)
* Fix some non-deterministic execution of minimize_wdba(), causing * Fix some non-deterministic execution of minimize_wdba(), causing
test-suite failures with the future G++ 7, and clang 3.9. test-suite failures with the future G++ 7, and clang 3.9.
* print_lbtt() had a memory leak when printing states without
successors.
New in spot 2.0.3 (2016-07-11) New in spot 2.0.3 (2016-07-11)
Bug fixes: Bug fixes:

View file

@ -65,9 +65,9 @@ namespace spot
// is not terribly efficient since we have to create the // is not terribly efficient since we have to create the
// iterator. // iterator.
twa_succ_iterator* it = aut_->succ_iter(s); twa_succ_iterator* it = aut_->succ_iter(s);
if (!it->first()) acc_cond::mark_t res = 0U;
return {}; if (it->first())
auto res = it->acc(); res = it->acc();
aut_->release_iter(it); aut_->release_iter(it);
return res; return res;
} }