Skip to content
Snippets Groups Projects

MuonTesterTree: Fix use-after-free error.

  1. Apr 01, 2024
    • scott snyder's avatar
      MuonTesterTree: Fix use-after-free error. · b7f8fd2c
      scott snyder authored
      In MuonTesterTree, m_branches_to_init must be listed before m_branches.
      When m_branches is destroyed, the branches being deleted will
      try to remove themselves from m_branches_to_init.  If these are
      in the opposite order, then m_branches_to_init will already
      have been destroyed, and we'll be accessing freed memory.
      
      Fixes crash seen during genconf in some builds of MuonGeoModelTest.
      
      Also rewrite Remove() to use remove_if.
      b7f8fd2c
Loading