diff options
author | Harald Welte <laforge@gnumonks.org> | 2017-07-12 00:38:25 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-07-12 00:38:25 +0200 |
commit | ff8eed24e769800c1f7e946d64a3247cb1d4a9ae (patch) | |
tree | 1b6afd94ced310088ece99958b848d6281818687 | |
parent | a06b877437a48ca14b8066663ea226dadee0014a (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.
Change-Id: Iff8506832d3472ab193b19b43cfbe7a9511075d1
Related: OS#2361
-rw-r--r-- | src/e1_input.c | 5 |
1 files changed, 5 insertions, 0 deletions
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 @@ e1inp_line_create(uint8_t e1_nr, const char *driver_name) 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++) { |