From bca2569a3b67b72bc6d56b1b8db1b239327ebe7d Mon Sep 17 00:00:00 2001 From: Donat Zenichev Date: Sat, 21 Sep 2024 09:55:40 +0200 Subject: [PATCH] MT#55283 Fix coverity scan defect 9903b413c5 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 --- daemon/sdp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/daemon/sdp.c b/daemon/sdp.c index e3bcd24ff3..4012cae829 100644 --- a/daemon/sdp.c +++ b/daemon/sdp.c @@ -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);