Change in ...osmo-sip-connector[master]: coverity: Address issue found by coverity

keith gerrit-no-reply at
Sat Aug 10 14:49:41 UTC 2019

keith has submitted this change and it was merged. ( )

Change subject: coverity: Address issue found by coverity

coverity: Address issue found by coverity

Add NULL checks on the return value of call_leg_other() in

If the remote side has requested media change and we cannot
find the other leg, then release call. This should not

Also, Add an assert to show that we cannot be here
without call type of SIP or MNCC (not related to coverity)

Fixes: CID#202863
Change-Id: I6f1f26533a25c93f243090bc02f1bc83b9108d42
M src/mncc.c
1 file changed, 11 insertions(+), 1 deletion(-)

  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  fixeria: Looks good to me, but someone else must approve
  keith: Looks good to me, approved

diff --git a/src/mncc.c b/src/mncc.c
index f5a44d5..e23bd6f 100644
--- a/src/mncc.c
+++ b/src/mncc.c
@@ -211,11 +211,21 @@
 	if (_leg->type == CALL_TYPE_MNCC) {
 		leg = (struct mncc_call_leg *) _leg;
 		struct call_leg *other = call_leg_other(&leg->base);
+		if (!other)
+			goto ret_release;
 		send_rtp_connect(leg, other);
-	} else {
+	} else if (_leg->type == CALL_TYPE_SIP) {
 		leg = (struct mncc_call_leg *) call_leg_other(_leg);
+		if (!leg)
+			goto ret_release;
 		send_rtp_connect(leg, _leg);
+	} else {
+		OSMO_ASSERT(false);
+	return;
+	LOGP(DMNCC, LOGL_ERROR, "Failed to find other leg.\n");
+	_leg->release_call(_leg);

To view, visit
To unsubscribe, or for help writing mail filters, visit

Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Change-Id: I6f1f26533a25c93f243090bc02f1bc83b9108d42
Gerrit-Change-Number: 15143
Gerrit-PatchSet: 5
Gerrit-Owner: keith <keith at>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at>
Gerrit-Reviewer: keith <keith at>
Gerrit-Reviewer: pespin <pespin at>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the gerrit-log mailing list