[MERGED] libosmo-abis[master]: 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
Thu Jul 13 07:57:43 UTC 2017


Harald Welte has submitted this change and it was merged.

Change subject: check for missing result of rate_ctr_group_alloc()
......................................................................


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.

Change-Id: Iff8506832d3472ab193b19b43cfbe7a9511075d1
Related: OS#2361
---
M src/e1_input.c
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/e1_input.c b/src/e1_input.c
index 40e36b4..3cf810f 100644
--- a/src/e1_input.c
+++ b/src/e1_input.c
@@ -364,6 +364,11 @@
 	line->num = e1_nr;
 
 	line->rate_ctr = rate_ctr_group_alloc(line, &e1inp_ctr_g_d, line->num);
+	if (!line->rate_ctr) {
+		LOGP(DLINP, LOGL_ERROR, "Cannot allocate counter group\n");
+		talloc_free(line);
+		return NULL;
+	}
 
 	line->num_ts = NUM_E1_TS;
 	for (i = 0; i < line->num_ts; i++) {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iff8506832d3472ab193b19b43cfbe7a9511075d1
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>



More information about the gerrit-log mailing list