aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gb_proxy.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-07-12 00:25:51 +0200
committerHarald Welte <laforge@gnumonks.org>2017-07-12 00:42:21 +0200
commit9f6760de2cf3166c169ba4018144e2cd95fafaff (patch)
tree6416e8141e373017bca3e675784a2ed52ecdeecf /openbsc/src/gprs/gb_proxy.c
parent38943b7b5e0afacbbaf06b351a35c03bf903fe2a (diff)
check for missing result of rate_ctr_group_alloc()
In case the counter group allocation fails, we must handle this gracefully and fail the allocation of the parent object, too. RelateD: OS#2361 Change-Id: I7dad4a4d52fe05f6b990359841b4408df5990e21
Diffstat (limited to 'openbsc/src/gprs/gb_proxy.c')
-rw-r--r--openbsc/src/gprs/gb_proxy.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c
index d95139f8d..3603e14e6 100644
--- a/openbsc/src/gprs/gb_proxy.c
+++ b/openbsc/src/gprs/gb_proxy.c
@@ -1431,6 +1431,10 @@ int gbproxy_init_config(struct gbproxy_config *cfg)
INIT_LLIST_HEAD(&cfg->bts_peers);
cfg->ctrg = rate_ctr_group_alloc(tall_bsc_ctx, &global_ctrg_desc, 0);
+ if (!cfg->ctrg) {
+ LOGP(DGPRS, LOGL_ERROR, "Cannot allocate global counter group!\n");
+ return -1;
+ }
clock_gettime(CLOCK_REALTIME, &tp);
return 0;