diff options
author | Harald Welte <laforge@gnumonks.org> | 2017-07-12 00:25:51 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-07-12 00:42:21 +0200 |
commit | 9f6760de2cf3166c169ba4018144e2cd95fafaff (patch) | |
tree | 6416e8141e373017bca3e675784a2ed52ecdeecf /openbsc/src/gprs/gb_proxy_peer.c | |
parent | 38943b7b5e0afacbbaf06b351a35c03bf903fe2a (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_peer.c')
-rw-r--r-- | openbsc/src/gprs/gb_proxy_peer.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/openbsc/src/gprs/gb_proxy_peer.c b/openbsc/src/gprs/gb_proxy_peer.c index 5365ff0fa..890968717 100644 --- a/openbsc/src/gprs/gb_proxy_peer.c +++ b/openbsc/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); |