Dmitry Timoshkov : windowscodecs: Fix a memory leak.
Alexandre Julliard
julliard at winehq.org
Thu Jun 29 15:23:24 CDT 2017
Module: wine
Branch: master
Commit: 2eeef78e8d9a8b3cd4b1272e5bce05d7c27d5f6a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2eeef78e8d9a8b3cd4b1272e5bce05d7c27d5f6a
Author: Dmitry Timoshkov <dmitry at baikal.ru>
Date: Thu Jun 29 12:03:59 2017 +0800
windowscodecs: Fix a memory leak.
Signed-off-by: Dmitry Timoshkov <dmitry at baikal.ru>
Signed-off-by: Vincent Povirk <vincent at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/windowscodecs/metadataquery.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/dlls/windowscodecs/metadataquery.c b/dlls/windowscodecs/metadataquery.c
index 473836f..e338848 100644
--- a/dlls/windowscodecs/metadataquery.c
+++ b/dlls/windowscodecs/metadataquery.c
@@ -212,7 +212,7 @@ static HRESULT get_token(struct string_t *elem, PROPVARIANT *id, PROPVARIANT *sc
hr = get_token(&next_elem, id, schema, idx);
if (hr != S_OK)
{
- TRACE("parse_elem error %#x\n", hr);
+ TRACE("get_token error %#x\n", hr);
return hr;
}
elem->len = (end - start) + next_elem.len;
@@ -248,7 +248,7 @@ static HRESULT get_token(struct string_t *elem, PROPVARIANT *id, PROPVARIANT *sc
if (*end == '\\') end++;
*bstr++ = *end++;
}
- if (!*end || *end != '}')
+ if (*end != '}')
{
PropVariantClear(&next_token);
return WINCODEC_ERR_INVALIDQUERYREQUEST;
@@ -260,7 +260,11 @@ static HRESULT get_token(struct string_t *elem, PROPVARIANT *id, PROPVARIANT *sc
{
id->vt = VT_CLSID;
id->u.puuid = CoTaskMemAlloc(sizeof(GUID));
- if (!id->u.puuid) return E_OUTOFMEMORY;
+ if (!id->u.puuid)
+ {
+ PropVariantClear(&next_token);
+ return E_OUTOFMEMORY;
+ }
hr = UuidFromStringW(next_token.u.bstrVal, id->u.puuid);
}
More information about the wine-cvs
mailing list