[PATCH] usp10: check heap_alloc return value (Coverity)

Marcus Meissner marcus at jet.franken.de
Fri May 21 14:11:30 CDT 2010


Hi,

Coverity found a missing NULL ptr check.

Ciao, Marcus
---
 dlls/usp10/usp10.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c
index 261b634..27fe3b0 100644
--- a/dlls/usp10/usp10.c
+++ b/dlls/usp10/usp10.c
@@ -1378,6 +1378,7 @@ HRESULT WINAPI ScriptShape(HDC hdc, SCRIPT_CACHE *psc, const WCHAR *pwcChars,
     if ((get_cache_pitch_family(psc) & TMPF_TRUETYPE) && !psa->fNoGlyphIndex)
     {
         WCHAR *rChars = heap_alloc(sizeof(WCHAR) * cChars);
+        if (!rChars) return E_OUTOFMEMORY;
         for (i = 0; i < cChars; i++)
         {
             int idx = i;
-- 
1.5.6



More information about the wine-patches mailing list