aboutsummaryrefslogtreecommitdiffstats
path: root/src/gb/gprs_bssgp.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2019-05-08 14:00:37 +0200
committerHarald Welte <laforge@gnumonks.org>2019-05-08 22:18:21 +0000
commit6d3135ce503bbc55575a0004ef02c72902be7370 (patch)
tree98152cfe96b19cbec0bc20b397744461037f9386 /src/gb/gprs_bssgp.c
parent3e323a29d27551b1c493c88d59e6f205550c728c (diff)
deal with rate_ctr_group_alloc() returning NULL
Diffstat (limited to 'src/gb/gprs_bssgp.c')
-rw-r--r--src/gb/gprs_bssgp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gb/gprs_bssgp.c b/src/gb/gprs_bssgp.c
index 550757f9..b695c284 100644
--- a/src/gb/gprs_bssgp.c
+++ b/src/gb/gprs_bssgp.c
@@ -128,6 +128,10 @@ struct bssgp_bvc_ctx *btsctx_alloc(uint16_t bvci, uint16_t nsei)
ctx->nsei = nsei;
/* FIXME: BVCI is not unique, only BVCI+NSEI ?!? */
ctx->ctrg = rate_ctr_group_alloc(ctx, &bssgp_ctrg_desc, bvci);
+ if (!ctx->ctrg) {
+ talloc_free(ctx);
+ return NULL;
+ }
ctx->fc = talloc_zero(ctx, struct bssgp_flow_control);
/* cofigure for 2Mbit, 30 packets in queue */
bssgp_fc_init(ctx->fc, 100000, 2*1024*1024/8, 30, &_bssgp_tx_dl_ud);