From: Jiajin Cui cuijiajin@uniontech.com
Fixed a memory leak in IPropertyStorage_fnDeleteMultiple when deleting properties by name. Previously, when deleting a property by its name, the code only removed the property from the propid_to_prop dictionary but failed to clean up the bidirectional mapping between property names and IDs in the propid_to_name and name_to_propid dictionaries. This resulted in orphaned dictionary entries and memory leaks.
The fix ensures proper cleanup of both dictionaries when deleting properties by name by: 1. Looking up the property name in the name_to_propid dictionary 2. Removing the property from propid_to_prop dictionary 3. Also removing the bidirectional mappings from propid_to_name and name_to_propid dictionaries
Signed-off-by: Jiajin Cui cuijiajin@uniontech.com --- dlls/ole32/stg_prop.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
diff --git a/dlls/ole32/stg_prop.c b/dlls/ole32/stg_prop.c index 0fe8ecc1840..7cc3d45ea72 100644 --- a/dlls/ole32/stg_prop.c +++ b/dlls/ole32/stg_prop.c @@ -918,7 +918,17 @@ static HRESULT WINAPI IPropertyStorage_fnDeleteMultiple( void *propid;
if (dictionary_find(This->name_to_propid, rgpspec[i].lpwstr, &propid)) + { + void *name; + dictionary_remove(This->propid_to_prop, propid); + + if (dictionary_find(This->propid_to_name, propid, &name)) + { + dictionary_remove(This->propid_to_name, propid); + dictionary_remove(This->name_to_propid, name); + } + } } else {