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
diff --git a/src/gprs/gb_proxy.c b/src/gprs/gb_proxy.c
index d95139f..3603e14 100644
--- a/src/gprs/gb_proxy.c
+++ b/src/gprs/gb_proxy.c
@@ -1431,6 +1431,10 @@
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;