From b1e9d59ae386159fdeeb76111bbb5fac986fe8ba Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Thu, 1 May 2014 09:59:01 +0000 Subject: [PATCH] [WIN32K] When no clip object is passed to EngGradientFill, use the global trivial one instead of creating a new one. Fixes memory leak. CID 716615 svn path=/trunk/; revision=63091 --- reactos/win32ss/gdi/eng/gradient.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/reactos/win32ss/gdi/eng/gradient.c b/reactos/win32ss/gdi/eng/gradient.c index 5dd9008ab24..784f21600cb 100644 --- a/reactos/win32ss/gdi/eng/gradient.c +++ b/reactos/win32ss/gdi/eng/gradient.c @@ -487,13 +487,11 @@ EngGradientFill( ULONG i; BOOL ret = FALSE; - if (!pco) + /* Check for NULL clip object */ + if (pco == NULL) { - pco = IntEngCreateClipRegion(0, 0, prclExtents); - if (!pco) - { - return FALSE; - } + /* Use the trivial one instead */ + pco = &gxcoTrivial.ClipObj; } switch(ulMode) -- 2.17.1