Author: akhaldi
Date: Fri May 3 09:57:19 2013
New Revision: 58913
URL:
http://svn.reactos.org/svn/reactos?rev=58913&view=rev
Log:
[WIN32SS]
* Plug a leak in IntGdiAddFontResource(). Original fix by Katayama Hirofumi MZ with one
more instance covered by Timo Kreuzer.
* Return 0 instead of status in the file mapping failure path. By Timo Kreuzer.
Modified:
trunk/reactos/win32ss/gdi/ntgdi/freetype.c
Modified: trunk/reactos/win32ss/gdi/ntgdi/freetype.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/gdi/ntgdi/freetype…
==============================================================================
--- trunk/reactos/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] (original)
+++ trunk/reactos/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] Fri May 3 09:57:19 2013
@@ -346,7 +346,8 @@
if (!NT_SUCCESS(Status))
{
DPRINT("Could not map file: %wZ\n", FileName);
- return Status;
+ ObDereferenceObject(SectionObject);
+ return 0;
}
IntLockFreeType;
@@ -357,6 +358,7 @@
0,
&Face);
IntUnLockFreeType;
+ ObDereferenceObject(SectionObject);
if (Error)
{
@@ -364,7 +366,6 @@
DPRINT("Unknown font file format\n");
else
DPRINT("Error reading font file (error code: %u)\n", Error);
- ObDereferenceObject(SectionObject);
return 0;
}
@@ -372,7 +373,6 @@
if (!Entry)
{
FT_Done_Face(Face);
- ObDereferenceObject(SectionObject);
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
return 0;
}
@@ -381,7 +381,6 @@
if (FontGDI == NULL)
{
FT_Done_Face(Face);
- ObDereferenceObject(SectionObject);
ExFreePoolWithTag(Entry, TAG_FONT);
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
return 0;
@@ -392,7 +391,6 @@
{
EngFreeMem(FontGDI);
FT_Done_Face(Face);
- ObDereferenceObject(SectionObject);
ExFreePoolWithTag(Entry, TAG_FONT);
EngSetLastError(ERROR_NOT_ENOUGH_MEMORY);
return 0;