aboutsummaryrefslogtreecommitdiffstats
path: root/src/gb/gprs_ns.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_ns.c
parent3e323a29d27551b1c493c88d59e6f205550c728c (diff)
deal with rate_ctr_group_alloc() returning NULL
Diffstat (limited to 'src/gb/gprs_ns.c')
-rw-r--r--src/gb/gprs_ns.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gb/gprs_ns.c b/src/gb/gprs_ns.c
index d72003ed..3679a5ba 100644
--- a/src/gb/gprs_ns.c
+++ b/src/gb/gprs_ns.c
@@ -333,6 +333,10 @@ struct gprs_nsvc *gprs_nsvc_create2(struct gprs_ns_inst *nsi, uint16_t nsvci,
nsvc->nsi = nsi;
osmo_timer_setup(&nsvc->timer, gprs_ns_timer_cb, nsvc);
nsvc->ctrg = rate_ctr_group_alloc(nsvc, &nsvc_ctrg_desc, nsvci);
+ if (!nsvc->ctrg) {
+ talloc_free(nsvc);
+ return NULL;
+ }
nsvc->statg = osmo_stat_item_group_alloc(nsvc, &nsvc_statg_desc, nsvci);
nsvc->sig_weight = sig_weight;
nsvc->data_weight = data_weight;