xmllite: Free elem in error paths (Coverity).

This commit is contained in:
Marcus Meissner 2013-05-09 10:59:43 +02:00 committed by Alexandre Julliard
parent af18f3e059
commit 51d96dac70

View File

@ -379,12 +379,18 @@ static HRESULT reader_push_element(xmlreader *reader, strval *qname)
if (!elem) return E_OUTOFMEMORY;
hr = reader_strvaldup(reader, qname, &elem->qname);
if (FAILED(hr)) return hr;
if (FAILED(hr)) {
reader_free(reader, elem);
return hr;
}
if (!list_empty(&reader->elements))
{
hr = reader_inc_depth(reader);
if (FAILED(hr)) return hr;
if (FAILED(hr)) {
reader_free(reader, elem);
return hr;
}
}
list_add_head(&reader->elements, &elem->entry);