[PATCH] dwrite: fixed memory leak on error (Coverity)

Marcus Meissner marcus at jet.franken.de
Sun Nov 2 04:10:22 CST 2014


1250624 Resource leak
---
 dlls/dwrite/font.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/dwrite/font.c b/dlls/dwrite/font.c
index 8420fdc..ed0a760 100644
--- a/dlls/dwrite/font.c
+++ b/dlls/dwrite/font.c
@@ -1476,8 +1476,10 @@ HRESULT create_font_collection(IDWriteFactory* factory, IDWriteFontFileEnumerato
             init_font_data(factory, file, i, face_type, font_data);
 
             hr = get_filestream_from_file(file, &stream);
-            if (FAILED(hr))
+            if (FAILED(hr)) {
+                heap_free (font_data);
                 return hr;
+            }
 
             /* get family name from font file */
             name_table = NULL;
-- 
1.8.4.5




More information about the wine-patches mailing list