[PATCH] oleaut32: local variable goes out of scope via pointer (Coverity)

Marcus Meissner meissner at suse.de
Fri Mar 4 03:43:42 CST 2011


Hi,

The pointer to the local block variable goes out of scope,
so move the FONTDESC struct up 1 block.

CID 2003

Ciao, Marcus
---
 dlls/oleaut32/olefont.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/dlls/oleaut32/olefont.c b/dlls/oleaut32/olefont.c
index f86ef20..e65504c 100644
--- a/dlls/oleaut32/olefont.c
+++ b/dlls/oleaut32/olefont.c
@@ -338,6 +338,7 @@ HRESULT WINAPI OleCreateFontIndirect(
 {
   OLEFontImpl* newFont = 0;
   HRESULT      hr      = S_OK;
+  FONTDESC     fd;
 
   TRACE("(%p, %s, %p)\n", lpFontDesc, debugstr_guid(riid), ppvObj);
   /*
@@ -349,8 +350,6 @@ HRESULT WINAPI OleCreateFontIndirect(
   *ppvObj = 0;
 
   if (!lpFontDesc) {
-    FONTDESC fd;
-
     static WCHAR fname[] = { 'S','y','s','t','e','m',0 };
 
     fd.cbSizeofstruct = sizeof(fd);
-- 
1.7.1



More information about the wine-patches mailing list