aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Yanitskiy <vyanitskiy@sysmocom.de>2023-12-12 22:34:20 +0700
committerVadim Yanitskiy <vyanitskiy@sysmocom.de>2023-12-12 22:34:22 +0700
commit2984d13e03100405adc9bc66b90f91d81b74eadb (patch)
treea9914155ceb3822f35a0cf77655dc59a69fe7836
parentc9801ed14a319a9de36458801f9b0a5a5c8b759b (diff)
silent_call: check return value of trans_alloc() against NULL
We're checking the result of trans_alloc() 6 out of 7 times, so check it in gsm_silent_call_start() too, for the sake of consistency. Change-Id: Ie989cd8146d66d9531cf3f3d84f46a2c6fcc2e5c Fixes: CID#322140
-rw-r--r--src/libmsc/silent_call.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libmsc/silent_call.c b/src/libmsc/silent_call.c
index 3b95a901f..4de12b9e2 100644
--- a/src/libmsc/silent_call.c
+++ b/src/libmsc/silent_call.c
@@ -140,7 +140,11 @@ int gsm_silent_call_start(struct vlr_subscr *vsub,
struct vty *vty)
{
struct gsm_network *net = vsub->vlr->user_ctx;
- struct gsm_trans *trans = trans_alloc(net, vsub, TRANS_SILENT_CALL, 0, 0);
+ struct gsm_trans *trans;
+
+ trans = trans_alloc(net, vsub, TRANS_SILENT_CALL, 0, 0);
+ if (trans == NULL)
+ return -ENODEV;
trans->silent_call.ct = *ct;
if (traffic_dst_ip) {