bgpd: Fix use after free in aspath_prepend with confeds

* bgp_aspath.c: (aspath_prepend) aspath_delete_confed_seq may result
  in as2 being updated, and seg2 becoming invalid. E.g. if the first
  segment of of as2 is confeds. However, code there after unconditionally
  reads from seg2.

  Reset seg2, and re-do the empty check on it.

  Caught by valgrinding tools/aspathtest.
1 file changed