From 79605f68354ad862d6d521406ee235c43a11b089 Mon Sep 17 00:00:00 2001 From: Max Date: Mon, 18 Sep 2017 16:10:18 +0200 Subject: gbproxy: ensure peer allocation result gbproxy_peer_alloc() could return NULL which wasn't checked and used right away. Fix it by making this assumption explicit with OSMO_ASSERT(); While at it, also format log messages consistently. Change-Id: Ib10c954e17a479baef31ded54370b35938e00018 --- src/gprs/gb_proxy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gprs/gb_proxy.c') diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c index eb2bbccd5..17a01091b 100644 --- a/src/gprs/gb_proxy.c +++ b/src/gprs/gb_proxy.c @@ -1018,9 +1018,9 @@ static int gbprox_rx_sig_from_bss(struct gbproxy_config *cfg, if (!from_peer) { /* if a PTP-BVC is reset, and we don't know that * PTP-BVCI yet, we should allocate a new peer */ - LOGP(DGPRS, LOGL_INFO, "Allocationg new peer for " - "BVCI=%u via NSEI=%u\n", bvci, nsei); + LOGP(DGPRS, LOGL_INFO, "Allocationg new peer for BVCI=%u via NSEI=%u\n", bvci, nsei); from_peer = gbproxy_peer_alloc(cfg, bvci); + OSMO_ASSERT(from_peer); from_peer->nsei = nsei; } -- cgit v1.2.3