From: Christophe CURIS <christophe.cu...@free.fr>

As pointed by Coverity, there are some cases where the name of the file
returned by wIconChooserDialog could be left unfreed.

Signed-off-by: Christophe CURIS <christophe.cu...@free.fr>
---
 src/appicon.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/src/appicon.c b/src/appicon.c
index 4d4d81e..43a0f32 100644
--- a/src/appicon.c
+++ b/src/appicon.c
@@ -534,13 +534,16 @@ static void setIconCallback(WMenu *menu, WMenuEntry 
*entry)
 
        result = wIconChooserDialog(scr, &file, icon->wm_instance, 
icon->wm_class);
 
-       if (result && !icon->destroyed) {
-               if (!wIconChangeImageFile(icon->icon, file)) {
-                       wMessageDialog(scr, _("Error"),
-                                      _("Could not open specified icon file"), 
_("OK"), NULL, NULL);
-               } else {
-                       wDefaultChangeIcon(icon->wm_instance, icon->wm_class, 
file);
-                       wAppIconPaint(icon);
+       if (result) {
+               if (!icon->destroyed) {
+                       if (!wIconChangeImageFile(icon->icon, file)) {
+                               wMessageDialog(scr, _("Error"),
+                                              _("Could not open specified icon 
file"),
+                                              _("OK"), NULL, NULL);
+                       } else {
+                               wDefaultChangeIcon(icon->wm_instance, 
icon->wm_class, file);
+                               wAppIconPaint(icon);
+                       }
                }
                if (file)
                        wfree(file);
-- 
1.9.2


-- 
To unsubscribe, send mail to wmaker-dev-unsubscr...@lists.windowmaker.org.

Reply via email to