From d292c6208038d08f85f81f15ddbed12d42d57602 Mon Sep 17 00:00:00 2001 From: Christophe CURIS Date: Tue, 20 May 2014 21:46:33 +0200 Subject: [PATCH] WMaker: fix memory leak in the windows icon chooser (Coverity #50117.2) 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 --- src/winspector.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/winspector.c b/src/winspector.c index b265f48e..e814fa32 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)