Rémi Bernon (@rbernon) commented about dlls/cfgmgr32/main.c:
free( all_keys ); if (FAILED( hr )) {
for (i = 0; i < obj->cPropertyCount; i++)
free( ( (DEVPROPERTY *)obj[i].pProperties )->Buffer );
free( (DEVPROPERTY *)obj->pProperties );
obj->cPropertyCount = 0;
obj->pProperties = NULL;
DevFreeObjectProperties( *props_len, *props );
You could probably implement and use `DevFreeObjectProperties` separately, it would avoid mixing unrelated changes together.