1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 12:28:22 +01:00

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 <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2014-05-20 21:46:33 +02:00
committed by Carlos R. Mafra
parent dc4df6455a
commit d292c62080

View File

@@ -971,12 +971,13 @@ static void chooseIconCallback(WMWidget *self, void *clientData)
if (result) { if (result) {
WMSetTextFieldText(panel->fileText, file); WMSetTextFieldText(panel->fileText, file);
showIconFor(WMWidgetScreen(self), panel, NULL, NULL, USE_TEXT_FIELD); showIconFor(WMWidgetScreen(self), panel, NULL, NULL, USE_TEXT_FIELD);
wfree(file);
} }
WMSetButtonEnabled(panel->browseIconBtn, True); WMSetButtonEnabled(panel->browseIconBtn, True);
} else { } else {
freeInspector(panel); freeInspector(panel);
} }
if (result)
wfree(file);
} }
static void textEditedObserver(void *observerData, WMNotification *notification) static void textEditedObserver(void *observerData, WMNotification *notification)