Brendan Shanks (@bshanks) commented about dlls/ntdll/unix/system.c:
- CFTimeInterval remain;
- if (IOPMCopyBatteryInfo( 0, &batteries ) != kIOReturnSuccess)
- CFTypeRef blob = IOPSCopyPowerSourcesInfo();
- CFArrayRef sources = IOPSCopyPowerSourcesList( blob );
- CFDictionaryRef source = NULL;
- CFTypeRef prop;
- Boolean is_charging;
- int32_t value, voltage;
- if (!sources)
- {
if (blob) CFRelease( blob ); return STATUS_ACCESS_DENIED;
- }
You can `CFRelease(blob)` at this point, and then remove all the calls from later in the function