Skip to content

Commit

Permalink
Fix potential memory leak
Browse files Browse the repository at this point in the history
src/hotplug_macosx.c:594:4 Potential leak of an object stored into 'valueRef'
  • Loading branch information
LudovicRousseau committed May 6, 2024
1 parent 11a48a0 commit dfa0690
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/hotplug_macosx.c
Original file line number Diff line number Diff line change
Expand Up @@ -568,6 +568,7 @@ HPDriversMatchPCCardDevices(HPDriver * driverBundle,
{
CFNumberGetValue((CFNumberRef) valueRef, kCFNumberSInt32Type,
&vendorId);
CFRelease(valueRef);
}
valueRef =
IORegistryEntryCreateCFProperty(pccDevice, CFSTR("DeviceID"),
Expand All @@ -580,6 +581,7 @@ HPDriversMatchPCCardDevices(HPDriver * driverBundle,
{
CFNumberGetValue((CFNumberRef) valueRef, kCFNumberSInt32Type,
&productId);
CFRelease(valueRef);
}
valueRef =
IORegistryEntryCreateCFProperty(pccDevice, CFSTR("SocketNumber"),
Expand All @@ -592,6 +594,7 @@ HPDriversMatchPCCardDevices(HPDriver * driverBundle,
{
CFNumberGetValue((CFNumberRef) valueRef, kCFNumberSInt32Type,
&pccAddress);
CFRelease(valueRef);
}
HPDriver *driver = driverBundle;

Expand Down

0 comments on commit dfa0690

Please sign in to comment.