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
This commit is contained in:
Holger Hans Peter Freyther 2016-03-31 19:36:27 +02:00
parent adc7484a0c
commit bec32eb207
2 changed files with 5 additions and 2 deletions

View File

@ -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);
}
}

View File

@ -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;