aboutsummaryrefslogtreecommitdiffstats
path: root/src/libbsc/net_init.c
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-07-12 00:25:51 +0200
committerNeels Hofmeyr <neels@hofmeyr.de>2017-08-27 03:52:45 +0200
commited208de125b5acc86646ab5fac1ea40e89a99924 (patch)
treee1f10fe007c5ec025a2f2a6a3915f20a207ef11c /src/libbsc/net_init.c
parent8e2e22ffb3695fec473bb4fb28d958870a143d54 (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/libbsc/net_init.c')
-rw-r--r--src/libbsc/net_init.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libbsc/net_init.c b/src/libbsc/net_init.c
index bc5ed3510..4dfc258a5 100644
--- a/src/libbsc/net_init.c
+++ b/src/libbsc/net_init.c
@@ -61,6 +61,10 @@ struct gsm_network *bsc_network_init(void *ctx,
/* init statistics */
net->bsc_ctrs = rate_ctr_group_alloc(net, &bsc_ctrg_desc, 0);
+ if (!net->bsc_ctrs) {
+ talloc_free(net);
+ return NULL;
+ }
gsm_net_update_ctype(net);