From bec32eb2073a5ae669260a7634bd91a245ce3e30 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 31 Mar 2016 19:36:27 +0200 Subject: [PATCH] coverity: Address two issues found by coverity Add NULL check in the case of MNCC disconnect that was missing and add an assert to show that at this point the other leg must exist. Fixes: CID#80799, CID#80800, 80801 --- src/app.c | 6 ++++-- src/mncc.c | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app.c b/src/app.c index 0fe149b..47ee150 100644 --- a/src/app.c +++ b/src/app.c @@ -44,8 +44,10 @@ void app_mncc_disconnected(struct mncc_connection *conn) */ LOGP(DAPP, LOGL_NOTICE, "Going to release call(%u) due MNCC.\n", call->id); - call_leg_release(call->initial); - call_leg_release(call->remote); + if (call->initial) + call_leg_release(call->initial); + if (call->remote) + call_leg_release(call->remote); } } diff --git a/src/mncc.c b/src/mncc.c index c25672d..84dac1d 100644 --- a/src/mncc.c +++ b/src/mncc.c @@ -167,6 +167,7 @@ static void mncc_call_leg_connect(struct call_leg *_leg) leg = (struct mncc_call_leg *) _leg; other = call_leg_other(_leg); + OSMO_ASSERT(other); if (!send_rtp_connect(leg, other)) return;