Skip to content

Commit

Permalink
MT#55283 Fix coverity scan defect 9903b41
Browse files Browse the repository at this point in the history
Fix coverity scan defect:

*** CID 1599922:  Control flow issues  (DEADCODE)
/daemon/sdp.c: 1822 in sdp_attr_append()
1816
1817     // Duplicate all attributes from the source (parsed SDP attributes list) into
1818     // the destination (string-format attribute list)
1819     static void sdp_attr_append(sdp_attr_q *dst, attributes_q *attrs) {
1820            if (!attrs)
1821                    return;
>>>     CID 1599922:  Control flow issues  (DEADCODE)
>>>     Execution cannot reach the expression "NULL" inside this statement: "ll = (attrs ? (*attrs).head...".
1822            for (__auto_type ll = attrs ? attrs->head : NULL; ll; ll = ll->next) {
1823                    __auto_type attr = ll->data;
1824                    struct sdp_attr *ac = sdp_attr_dup(attr);
1825                    t_queue_push_tail(dst, ac);
1826            }
1827     }

Change-Id: Ia16b99c765888d0427a833fd6e9bb55567dbb070
  • Loading branch information
zenichev committed Sep 21, 2024
1 parent 33da018 commit bca2569
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion daemon/sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1819,7 +1819,7 @@ void sdp_orig_free(sdp_origin *o) {
static void sdp_attr_append(sdp_attr_q *dst, attributes_q *attrs) {
if (!attrs)
return;
for (__auto_type ll = attrs ? attrs->head : NULL; ll; ll = ll->next) {
for (__auto_type ll = attrs->head; ll; ll = ll->next) {
__auto_type attr = ll->data;
struct sdp_attr *ac = sdp_attr_dup(attr);
t_queue_push_tail(dst, ac);
Expand Down

0 comments on commit bca2569

Please sign in to comment.