Nikolay Sivov : dwrite: Fix potential strings object leak (Coverity).

Alexandre Julliard julliard at winehq.org
Mon Feb 3 15:06:05 CST 2020


Module: wine
Branch: master
Commit: 9f1dd9fc3ef11e6343ef96512ed1632a705164d2
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=9f1dd9fc3ef11e6343ef96512ed1632a705164d2

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Mon Feb  3 10:32:14 2020 +0300

dwrite: Fix potential strings object leak (Coverity).

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dwrite/opentype.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/dlls/dwrite/opentype.c b/dlls/dwrite/opentype.c
index 0aa1b10460..9813676ab0 100644
--- a/dlls/dwrite/opentype.c
+++ b/dlls/dwrite/opentype.c
@@ -2166,10 +2166,6 @@ static HRESULT opentype_get_font_strings_from_meta(const struct file_stream_desc
 
     *ret = NULL;
 
-    hr = create_localizedstrings(&strings);
-    if (FAILED(hr))
-        return hr;
-
     switch (id)
     {
         case DWRITE_INFORMATIONAL_STRING_DESIGN_SCRIPT_LANGUAGE_TAG:
@@ -2183,6 +2179,9 @@ static HRESULT opentype_get_font_strings_from_meta(const struct file_stream_desc
             return S_OK;
     }
 
+    if (FAILED(hr = create_localizedstrings(&strings)))
+        return hr;
+
     opentype_get_font_table(stream_desc, MS_META_TAG, &meta);
 
     if (meta.data)




More information about the wine-cvs mailing list