From e522ca734d0559acee95f1521ca85e56ee7855b5 Mon Sep 17 00:00:00 2001 From: Tobias Stoeckmann Date: Sun, 18 Feb 2007 03:47:47 +0100 Subject: [PATCH] WINGs: Fix memory leak in wtokenfree() wtokenfree() does not free the first entry of an array. If count is 1 then while (--count) will be while (0) and the inner body of that while-loop will not be entered. Therefore a memory leak happens every time wtokenfree() is called. Retrieved-from: http://paldium.homeunix.org/tobias/wmaker/patches/ [crmafra: This patch, altough correct, breaks WPrefs.app, which will be fixed by the next patch. ] --- WINGs/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WINGs/string.c b/WINGs/string.c index d01437e0..70277c8a 100644 --- a/WINGs/string.c +++ b/WINGs/string.c @@ -140,7 +140,7 @@ char *wtokenjoin(char **list, int count) void wtokenfree(char **tokens, int count) { - while (--count) + while (count--) wfree(tokens[count]); wfree(tokens); } -- 2.11.4.GIT