From: Alex Henrie Subject: [PATCH 1/2] kernel32: Fix memory leak in WCEL_MoveToHist. Message-Id: <20160623072554.12041-1-alexhenrie24@gmail.com> Date: Thu, 23 Jun 2016 01:25:23 -0600 Cc: Eric Pouech Coverity #713501, "Variable data going out of scope leaks the storage it points to." Signed-off-by: Alex Henrie --- dlls/kernel32/editline.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dlls/kernel32/editline.c b/dlls/kernel32/editline.c index b436a50..bcfdece 100644 --- a/dlls/kernel32/editline.c +++ b/dlls/kernel32/editline.c @@ -428,9 +428,9 @@ static void WCEL_MoveToHist(WCEL_Context* ctx, int idx) if (WCEL_Grow(ctx, len)) { WCEL_InsertString(ctx, data); - HeapFree(GetProcessHeap(), 0, data); ctx->histPos = idx; } + HeapFree(GetProcessHeap(), 0, data); } static void WCEL_FindPrevInHist(WCEL_Context* ctx) -- 2.9.0