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

As pointed by Coverity, a string could be left unfreed in the case where
the docked application's settings 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/dockedapp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/dockedapp.c b/src/dockedapp.c
index 63a4864..a7bca3b 100644
--- a/src/dockedapp.c
+++ b/src/dockedapp.c
@@ -136,7 +136,6 @@ static void chooseIconCallback(WMWidget * self, void 
*clientData)
        if (!panel->destroyed) {
                if (result) {
                        WMSetTextFieldText(panel->iconField, file);
-                       wfree(file);
                        updateSettingsPanelIcon(panel);
                }
 
@@ -146,6 +145,8 @@ static void chooseIconCallback(WMWidget * self, void 
*clientData)
                 * the icon chooser */
                DestroyDockAppSettingsPanel(panel);
        }
+       if (result)
+               wfree(file);
 }
 
 static void panelBtnCallback(WMWidget * self, void *data)
-- 
1.9.2


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

Reply via email to