aboutsummaryrefslogtreecommitdiffstats
path: root/src/gprs/gtphub.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-07-17 23:59:39 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2017-08-27 17:40:54 +0200
commitd939ac0cf4c32998f6a37b47f301f168de1ec7a4 (patch)
tree54d923cdcf96abe422935f0d4802c0f15dc28798 /src/gprs/gtphub.c
parent23a6812a0910984b87485f735cd4b2f950a33e3d (diff)
gtphob: 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. The recent change (Id I7dad4a4d52fe05f6b990359841b4408df5990e21) seems to have missed one instance, so let's follow-up. Change-Id: I1ee9e3d26dcc18e7f979fd9a786162cbcc50942c Related: OS#2361
Diffstat (limited to 'src/gprs/gtphub.c')
-rw-r--r--src/gprs/gtphub.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gprs/gtphub.c b/src/gprs/gtphub.c
index 211018b..5e7520e 100644
--- a/src/gprs/gtphub.c
+++ b/src/gprs/gtphub.c
@@ -2708,6 +2708,10 @@ static struct gtphub_peer_port *gtphub_addr_add_port(struct gtphub_peer_addr *a,
pp->counters_io = rate_ctr_group_alloc(osmo_gtphub_ctx,
&gtphub_ctrg_io_desc, 0);
+ if (!pp->counters_io) {
+ talloc_free(pp);
+ return NULL;
+ }
llist_add(&pp->entry, &a->ports);