WPrefs: Fix crash due to wtokenfree() memory leak fix

After the fix to avoid a memory leak in wtokenfree(), WPrefs crashes
when opening the 'Applications Menu Definition' dialogue.

The problem is that WPrefs code relied on the fact that the first token
in the array would not be free'd by wtokenfree(), a misbehaviour which
is correctly addressed with this patch.

Retrieved-from: http://www.mail-archive.com/ports@openbsd.org/msg12731.html

[crmafra: small changes in the commit log from the webpage]
This commit is contained in:
Pedro Martelletto authored and Carlos R. Mafra committed 2009-08-22 20:51:47 +02:00
1 parent e522ca734d
commit 2706f7217c
1 file changed
-1
-1
View File
@@ -981,7 +981,6 @@ static ItemData *parseCommand(WMPropList * item)
for (i = 0, j = 0; i < tokn; i++) {
if (strcmp(tokens[i], "-noext") == 0) {
wfree(tokens[i]);
data->param.directory.stripExt = 1;
} else {
ctokens[j++] = tokens[i];