Yongjie Yao : msxml3: Fix a memory leak (Valgrind).

Alexandre Julliard julliard at winehq.org
Tue Mar 23 15:07:45 CDT 2021


Module: wine
Branch: oldstable
Commit: ade6d16750692fcdcfee7f5851fbddb117851417
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=ade6d16750692fcdcfee7f5851fbddb117851417

Author: Yongjie Yao <yaoyongjie at uniontech.com>
Date:   Fri Sep 11 15:41:58 2020 +0000

msxml3: Fix a memory leak (Valgrind).

Signed-off-by: Yongjie Yao <yaoyongjie at uniontech.com>
Signed-off-by: Myah Caron <qsniyg at protonmail.com>
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 9336ec8faf2e2f2420698f40c02988877781bfef)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>

---

 dlls/msxml3/domdoc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c
index 76d3fdb6018..3dc98279f43 100644
--- a/dlls/msxml3/domdoc.c
+++ b/dlls/msxml3/domdoc.c
@@ -796,13 +796,17 @@ static HRESULT domdoc_load_from_stream(domdoc *doc, ISequentialStream *stream)
 
     hr = GetHGlobalFromStream(hstream, &hglobal);
     if (FAILED(hr))
+    {
+        IStream_Release(hstream);
         return hr;
+    }
 
     len = GlobalSize(hglobal);
     ptr = GlobalLock(hglobal);
     if (len)
         xmldoc = doparse(doc, ptr, len, XML_CHAR_ENCODING_NONE);
     GlobalUnlock(hglobal);
+    IStream_Release(hstream);
 
     if (!xmldoc)
     {




More information about the wine-cvs mailing list