Skip to content

Commit

Permalink
Merge pull request #730 from Glowcloud/melodic-devel
Browse files Browse the repository at this point in the history
Fix for Potential Memory Leak  in AmclNode::reconfigureCB #729
  • Loading branch information
mikeferguson authored May 23, 2018
2 parents 01bf41d + b2d910d commit 7f35563
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion amcl/src/amcl_node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,12 @@ void AmclNode::reconfigureCB(AMCLConfig &config, uint32_t level)
do_beamskip_= config.do_beamskip;
beam_skip_distance_ = config.beam_skip_distance;
beam_skip_threshold_ = config.beam_skip_threshold;


if( pf_ != NULL )
{
pf_free( pf_ );
pf_ = NULL;
}
pf_ = pf_alloc(min_particles_, max_particles_,
alpha_slow_, alpha_fast_,
(pf_init_model_fn_t)AmclNode::uniformPoseGenerator,
Expand Down

0 comments on commit 7f35563

Please sign in to comment.