MT#56126 Fix a defect noticed by Cov.Scan (introduced by: 8595f95)

1872 /* first add those mentioned in the order list,
1873  * but only, if they were previously generated/added to the sdes_out */
>>> CID 1530346:  Control flow issues  (DEADCODE)
>>> Execution cannot reach the expression "NULL" inside this statement: "l = (cpq_order ? cpq_order-...".
1874   for (GList *l = cpq_order ? cpq_order->head : NULL; l; l = l->next)

Change-Id: I58f84ba82d215a9eb6cbd97548e8e9e8a954bdc6
pull/1621/head
Donat Zenichev 3 years ago
parent edeb41d6f1
commit aaff8863ab

@ -1688,13 +1688,12 @@ static void __generate_crypto(const struct sdp_ng_flags *flags, struct call_medi
GQueue *cpq_in = &this->sdes_in;
const GQueue *offered_cpq = other ? &other->sdes_in : NULL;
if (!flags)
return;
/* requested order of crypto suites */
const GQueue *cpq_order = &flags->sdes_order;
if (!flags)
return;
bool is_offer = (flags->opmode == OP_OFFER || flags->opmode == OP_REQUEST);
if (!this->protocol || !this->protocol->srtp || MEDIA_ISSET(this, PASSTHRU)) {
@ -1871,7 +1870,7 @@ static void __generate_crypto(const struct sdp_ng_flags *flags, struct call_medi
/* first add those mentioned in the order list,
* but only, if they were previously generated/added to the sdes_out */
for (GList *l = cpq_order ? cpq_order->head : NULL; l; l = l->next)
for (GList *l = cpq_order->head; l; l = l->next)
{
str * cs_name = l->data;
struct crypto_params_sdes * cps_order;

Loading…
Cancel
Save