bssgp: Only call bssgp_tx_llc_discarded if the bctx exists
While this does not happen in real use, and unset btcx can lead to
segfaults in test cases. The other code outside of gprs_bssgp_pcu.cpp
does not depend on bctx being non-NULL:
Sponsored-by: On-Waves ehf
diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index a0510f6..39a1f33 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -318,7 +318,8 @@
frames = 0xff;
if (octets > 0xffffff)
octets = 0xffffff;
- bssgp_tx_llc_discarded(bctx, tlli(), frames, octets);
+ if (bctx)
+ bssgp_tx_llc_discarded(bctx, tlli(), frames, octets);
}
return msg;