aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs/gb_proxy_peer.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-07-12 00:25:51 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2017-08-27 17:40:54 +0200
commit26c146547590c61b0fa4461c203cbe6194669d6e (patch)
tree298adc03dd46e0400bff93900355098e5e6818cf /src/gprs/gb_proxy_peer.c
parentbf982e066df041f22ebd86b34608cc26b10523be (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 'src/gprs/gb_proxy_peer.c')
-rw-r--r--src/gprs/gb_proxy_peer.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gprs/gb_proxy_peer.c b/src/gprs/gb_proxy_peer.c
index 5365ff0fa..890968717 100644
--- a/src/gprs/gb_proxy_peer.c
+++ b/src/gprs/gb_proxy_peer.c
@@ -177,6 +177,10 @@ struct gbproxy_peer *gbproxy_peer_alloc(struct gbproxy_config *cfg, uint16_t bvc
peer->bvci = bvci;
peer->ctrg = rate_ctr_group_alloc(peer, &peer_ctrg_desc, bvci);
+ if (!peer->ctrg) {
+ talloc_free(peer);
+ return NULL;
+ }
peer->cfg = cfg;
llist_add(&peer->list, &cfg->bts_peers);