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

WMaker: fix memory leak in the window inspector when saving settings (Coverity #50175)

As pointed by Coverity, there is one case where the string returned by
WMGetTextFieldText could be left allocated.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS
2014-05-20 21:46:48 +02:00
committed by Carlos R. Mafra
parent e750f9307e
commit 788a51c116

View File

@@ -488,11 +488,13 @@ static void saveSettings(WMWidget *button, void *client_data)
/* The icon filename (if exists) */
icon_file = WMGetTextFieldText(panel->fileText);
if ((icon_file) && (icon_file[0] != 0)) {
value = WMCreatePLString(icon_file);
different |= insertAttribute(dict, winDic, AIcon, value, flags);
different2 |= insertAttribute(dict, appDic, AIcon, value, flags);
WMReleasePropList(value);
if (icon_file != NULL) {
if (icon_file[0] != '\0') {
value = WMCreatePLString(icon_file);
different |= insertAttribute(dict, winDic, AIcon, value, flags);
different2 |= insertAttribute(dict, appDic, AIcon, value, flags);
WMReleasePropList(value);
}
wfree(icon_file);
}