From dc4df6455a2868577c04279af04bf4741e9b0d02 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Tue, 20 May 2014 21:46:32 +0200 Subject: [PATCH] WMaker: fix memory leak in the docked apps icon chooser (Coverity #50117.1) 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 --- src/dockedapp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dockedapp.c b/src/dockedapp.c index 63a4864d..a7bca3bd 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)