[PATCH v2] msxml3: Fix a memory leak (Valgrind).
Nikolay Sivov
nsivov at codeweavers.com
Thu Sep 10 03:18:40 CDT 2020
Hi,
This looks good, thank you. Few comments below.
> Signed-off-by: yaoyongjie <yaoyongjie at uniontech.com>
Please make your name in this line match From: in your email.
> hr = GetHGlobalFromStream(hstream, &hglobal);
> if (FAILED(hr))
> + {
> + IStream_Release(hstream);
> return hr;
> + }
This won't fail in practice, but I'm fine with keeping it obvious.
> @@ -807,10 +810,12 @@ static HRESULT domdoc_load_from_stream(domdoc
> *doc, ISequentialStream *stream)
>
> if (!xmldoc)
> {
> + IStream_Release(hstream);
> ERR("Failed to parse xml\n");
> return E_FAIL;
> }
>
> + IStream_Release(hstream);
> xmldoc->_private = create_priv();
It has to be released on all paths, so let's have IStream_Release()
right after GlobalUnlock(hglobal).
More information about the wine-devel
mailing list