Merge pull request #758 from borglab/fix-potential-crash

Avoid potential wrong memory access
release/4.3a0
Frank Dellaert 2021-04-28 11:05:23 -04:00 committed by GitHub
commit 6097b8f8e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -355,7 +355,7 @@ class FactorGraph {
/** delete factor without re-arranging indexes by inserting a nullptr pointer
*/
void remove(size_t i) { factors_[i].reset(); }
void remove(size_t i) { factors_.at(i).reset(); }
/** replace a factor by index */
void replace(size_t index, sharedFactor factor) { at(index) = factor; }