Esme Povirk (@madewokherd) commented about dlls/windowscodecs/metadataquery.c:
ULONG fetched_items;if (!(vars = calloc(vars_count * 2, sizeof(*vars))))return E_OUTOFMEMORY;schemas = vars;ids = vars + vars_count;fetched_items = 0;if (SUCCEEDED(hr = IWICEnumMetadataItem_Next(enumerator->metadata_enumerator, count, schemas, ids, NULL, &fetched_items))){for (ULONG i = 0; i < fetched_items && SUCCEEDED(hr); ++i){WCHAR *schema_name = NULL, *id_name = NULL;size_t size;if (schemas[i].vt != VT_EMPTY)
I think that if we break the loop early due to a failing hr, the later values in `schemas` and `ids` are leaked. I suggest moving `SUCCEEDED(hr)` from the loop test into this if statement.