mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-23 14:42:29 +01:00
WPrefs: fix memory leak when saving window handling settings (Coverity #50158)
As pointed by Coverity, the functions WMCreatePLString return a newly allocated WMPropList, which must be released when not needed anymore. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
f4f96a8fb7
commit
8eb6c82231
@@ -222,7 +222,8 @@ static void showData(_Panel * panel)
|
|||||||
static void storeData(_Panel * panel)
|
static void storeData(_Panel * panel)
|
||||||
{
|
{
|
||||||
WMPropList *arr;
|
WMPropList *arr;
|
||||||
char x[16], y[16];
|
WMPropList *x, *y;
|
||||||
|
char buf[16];
|
||||||
|
|
||||||
SetBoolForKey(WMGetButtonSelected(panel->miconB), "NoWindowOverIcons");
|
SetBoolForKey(WMGetButtonSelected(panel->miconB), "NoWindowOverIcons");
|
||||||
SetBoolForKey(WMGetButtonSelected(panel->mdockB), "NoWindowOverDock");
|
SetBoolForKey(WMGetButtonSelected(panel->mdockB), "NoWindowOverDock");
|
||||||
@@ -234,9 +235,13 @@ static void storeData(_Panel * panel)
|
|||||||
SetBoolForKey(WMGetButtonSelected(panel->tranB), "OpenTransientOnOwnerWorkspace");
|
SetBoolForKey(WMGetButtonSelected(panel->tranB), "OpenTransientOnOwnerWorkspace");
|
||||||
|
|
||||||
SetStringForKey(placements[WMGetPopUpButtonSelectedItem(panel->placP)], "WindowPlacement");
|
SetStringForKey(placements[WMGetPopUpButtonSelectedItem(panel->placP)], "WindowPlacement");
|
||||||
sprintf(x, "%i", WMGetSliderValue(panel->hsli));
|
sprintf(buf, "%i", WMGetSliderValue(panel->hsli));
|
||||||
sprintf(y, "%i", WMGetSliderValue(panel->vsli));
|
x = WMCreatePLString(buf);
|
||||||
arr = WMCreatePLArray(WMCreatePLString(x), WMCreatePLString(y), NULL);
|
sprintf(buf, "%i", WMGetSliderValue(panel->vsli));
|
||||||
|
y = WMCreatePLString(buf);
|
||||||
|
arr = WMCreatePLArray(x, y, NULL);
|
||||||
|
WMReleasePropList(x);
|
||||||
|
WMReleasePropList(y);
|
||||||
SetObjectForKey(arr, "WindowPlaceOrigin");
|
SetObjectForKey(arr, "WindowPlaceOrigin");
|
||||||
|
|
||||||
SetIntegerForKey(WMGetSliderValue(panel->resS), "EdgeResistance");
|
SetIntegerForKey(WMGetSliderValue(panel->resS), "EdgeResistance");
|
||||||
|
|||||||
Reference in New Issue
Block a user