diff options
author | Harald Welte <laforge@gnumonks.org> | 2017-07-12 00:25:51 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2017-08-27 03:52:45 +0200 |
commit | ed208de125b5acc86646ab5fac1ea40e89a99924 (patch) | |
tree | e1f10fe007c5ec025a2f2a6a3915f20a207ef11c /src/libcommon-cs | |
parent | 8e2e22ffb3695fec473bb4fb28d958870a143d54 (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 'src/libcommon-cs')
-rw-r--r-- | src/libcommon-cs/common_cs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libcommon-cs/common_cs.c b/src/libcommon-cs/common_cs.c index 8e19bb2b8..99206c86c 100644 --- a/src/libcommon-cs/common_cs.c +++ b/src/libcommon-cs/common_cs.c @@ -68,6 +68,10 @@ struct gsm_network *gsm_network_init(void *ctx, /* init statistics */ net->msc_ctrs = rate_ctr_group_alloc(net, &msc_ctrg_desc, 0); + if (!net->msc_ctrs) { + talloc_free(net); + return NULL; + } net->active_calls = osmo_counter_alloc("msc.active_calls"); net->mncc_recv = mncc_recv; |