From: Christophe CURIS <[email protected]>

As pointed by Coverity, text cannot be null in this part of code. The
analysis shows that if it were, the function wIconChangeImageFile would
have directed execution to the 'else' branch. (and if it hadn't, the code
would have crashed beforehand because 'strlen' does not like null pointers)

Coverity recommends to remove the unnecessary check for code the
maintainability.

Signed-off-by: Christophe CURIS <[email protected]>
---
 src/dockedapp.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/dockedapp.c b/src/dockedapp.c
index 6812ed1..44eaacd 100644
--- a/src/dockedapp.c
+++ b/src/dockedapp.c
@@ -170,8 +170,7 @@ static void panelBtnCallback(WMWidget * self, void *data)
                        snprintf(buf, len, _("Could not open specified icon 
file: %s"), text);
                        if (wMessageDialog(panel->wwin->screen_ptr, _("Error"), 
buf,
                                           _("OK"), _("Ignore"), NULL) == 
WAPRDefault) {
-                               if (text)
-                                       wfree(text);
+                               wfree(text);
                                wfree(buf);
                                return;
                        }
-- 
2.1.1


-- 
To unsubscribe, send mail to [email protected].

Reply via email to