WPrefs: fix memory leak when saving settings (Coverity #50140 + #50157 + #50159)

As pointed by Coverity, the string returned by 'WMGetTextFieldText' is
allocated dynamically, so it must be freed when not needed anymore.

Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
Christophe CURIS authored and Carlos R. Mafra committed 2014-06-01 20:35:06 +01:00
1 parent 27a2259934
commit 894d1c80a3
3 files changed
+7 -1

No files matched your search

+1
View File
@@ -750,6 +750,7 @@ static void storeData(_Panel * panel)
tmp = WMGetTextFieldText(panel->ddelaT);
if (sscanf(tmp, "%i", &i) == 1 && i > 0)
SetIntegerForKey(i, "DoubleClickTime");
wfree(tmp);
SetBoolForKey(WMGetButtonSelected(panel->disaB), "DisableWSMouseActions");