- GNUNET_break (GNUNET_YES ==
- GNUNET_ATS_address_del_session (ai->ar,
- session));
+ /* Address expired but not blocked, and thus 'ar' was still
+ live because of the session; deleting just the session
+ will do for an inbound session, but for an outbound we
+ then also need to destroy the address with ATS. */
+ if (GNUNET_NO ==
+ GNUNET_ATS_address_del_session (ai->ar,
+ session))
+ {
+ GNUNET_ATS_address_destroy (ai->ar);
+ }
+ /* "ar" has been freed, regardless how the branch
+ above played out: it was either freed in
+ #GNUNET_ATS_address_del_session() because it was
+ incoming, or explicitly in
+ #GNUNET_ATS_address_del_session(). */
+ ai->ar = NULL;