hiyohiyo / CrystalDiskInfo

CrystalDiskInfo
https://github.com/hiyohiyo/CrystalDiskInfo
MIT License
1.59k stars 177 forks source link

Fix resource leaks #243

Open Bobini1 opened 5 months ago

Bobini1 commented 5 months ago

I have found two places in the code where resources are not released correctly.

It is possible to revert the deletion of SAFE_RELEASE(pCOMDev); from line 64 if you believe VariantInit, VariantClear or IWbemClassObject::Get could throw an exception that would skip over line 56.

EDIT: I have found two more places where resources can be leaked.