Commit 2eeef78e authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

windowscodecs: Fix a memory leak.

parent 97546cfb
...@@ -212,7 +212,7 @@ static HRESULT get_token(struct string_t *elem, PROPVARIANT *id, PROPVARIANT *sc ...@@ -212,7 +212,7 @@ static HRESULT get_token(struct string_t *elem, PROPVARIANT *id, PROPVARIANT *sc
hr = get_token(&next_elem, id, schema, idx); hr = get_token(&next_elem, id, schema, idx);
if (hr != S_OK) if (hr != S_OK)
{ {
TRACE("parse_elem error %#x\n", hr); TRACE("get_token error %#x\n", hr);
return hr; return hr;
} }
elem->len = (end - start) + next_elem.len; elem->len = (end - start) + next_elem.len;
...@@ -248,7 +248,7 @@ static HRESULT get_token(struct string_t *elem, PROPVARIANT *id, PROPVARIANT *sc ...@@ -248,7 +248,7 @@ static HRESULT get_token(struct string_t *elem, PROPVARIANT *id, PROPVARIANT *sc
if (*end == '\\') end++; if (*end == '\\') end++;
*bstr++ = *end++; *bstr++ = *end++;
} }
if (!*end || *end != '}') if (*end != '}')
{ {
PropVariantClear(&next_token); PropVariantClear(&next_token);
return WINCODEC_ERR_INVALIDQUERYREQUEST; return WINCODEC_ERR_INVALIDQUERYREQUEST;
...@@ -260,7 +260,11 @@ static HRESULT get_token(struct string_t *elem, PROPVARIANT *id, PROPVARIANT *sc ...@@ -260,7 +260,11 @@ static HRESULT get_token(struct string_t *elem, PROPVARIANT *id, PROPVARIANT *sc
{ {
id->vt = VT_CLSID; id->vt = VT_CLSID;
id->u.puuid = CoTaskMemAlloc(sizeof(GUID)); 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); hr = UuidFromStringW(next_token.u.bstrVal, id->u.puuid);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment