[PATCH v3] msxml3: Fix a memory leak (Valgrind).
Myah Caron
qsniyg at protonmail.com
Fri Sep 11 10:41:58 CDT 2020
From: Yongjie Yao <yaoyongjie at uniontech.com>
Signed-off-by: Yongjie Yao <yaoyongjie at uniontech.com>
Signed-off-by: Myah Caron <qsniyg at protonmail.com>
---
v3:
Following Nikolay's comments:
- Move IStream_Release below GlobalUnlock.
- Use the name displayed by their From: address for Signed-off-by.
dlls/msxml3/domdoc.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/dlls/msxml3/domdoc.c b/dlls/msxml3/domdoc.c
index 8d45c546fb5..d447bd2b1d8 100644
--- a/dlls/msxml3/domdoc.c
+++ b/dlls/msxml3/domdoc.c
@@ -797,13 +797,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)
{
--
2.28.0
More information about the wine-devel
mailing list