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

As pointed by Coverity, a string could be left unfreed in the case where
the window's attribute dialog is closed before an icon would be actually
chosen from the Icon Chooser Dialog.

Signed-off-by: Christophe CURIS <christophe.cu...@free.fr>
---
 src/winspector.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/winspector.c b/src/winspector.c
index b265f48..e814fa3 100644
--- a/src/winspector.c
+++ b/src/winspector.c
@@ -971,12 +971,13 @@ static void chooseIconCallback(WMWidget *self, void 
*clientData)
                if (result) {
                        WMSetTextFieldText(panel->fileText, file);
                        showIconFor(WMWidgetScreen(self), panel, NULL, NULL, 
USE_TEXT_FIELD);
-                       wfree(file);
                }
                WMSetButtonEnabled(panel->browseIconBtn, True);
        } else {
                freeInspector(panel);
        }
+       if (result)
+               wfree(file);
 }
 
 static void textEditedObserver(void *observerData, WMNotification 
*notification)
-- 
1.9.2


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

Reply via email to