sgsn: Free MM context after receiving a Detach Request

On a Detach/Re-attach cycle the Address Sanitizer detected a
use-after-free kind of problem. That is because we tried to
destroy the LLME twice. The first time it is destroyed as part
of the Detach handling ans the second time it is destroyed as
part of destroying the old MM context.

In case the GPRS GMM detach message is lost the SGSN needs
to reply besides not having a MM entry.

The alternative would have been to add NULL checks for all
usages of ctx->llme which would not have helped with the
readability.

Sponsored-by: On-Waves ehf
2 files changed
tree: a6067954c0bb7a7aa8e116a7cb1af384ec142649
  1. debian/
  2. hlrsync/
  3. linux-kernel/
  4. openbsc/
  5. wireshark/
  6. README