[PATCH] openbsc[master]: gtphob: check for missing result of rate_ctr_group_alloc()

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Mon Jul 17 22:04:35 UTC 2017


Review at  https://gerrit.osmocom.org/3270

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
---
M openbsc/src/gprs/gtphub.c
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/70/3270/1

diff --git a/openbsc/src/gprs/gtphub.c b/openbsc/src/gprs/gtphub.c
index 211018b..5e7520e 100644
--- a/openbsc/src/gprs/gtphub.c
+++ b/openbsc/src/gprs/gtphub.c
@@ -2708,6 +2708,10 @@
 
 	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);
 

-- 
To view, visit https://gerrit.osmocom.org/3270
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1ee9e3d26dcc18e7f979fd9a786162cbcc50942c
Gerrit-PatchSet: 1
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list