Skip to content

Commit

Permalink
Fix potential memory leak
Browse files Browse the repository at this point in the history
src/hotplug_macosx.c:738:11 Potential leak of memory pointed to by 'devices'
  • Loading branch information
LudovicRousseau committed May 6, 2024
1 parent 7af67de commit 11a48a0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/hotplug_macosx.c
Original file line number Diff line number Diff line change
Expand Up @@ -728,10 +728,20 @@ static int HPScan(void)
HPDeviceList devices = NULL;

if (HPDriversMatchUSBDevices(Drivers, &devices))
{
if (devices)
free(devices);

return -1;
}

if (HPDriversMatchPCCardDevices(Drivers, &devices))
{
if (devices)
free(devices);

return -1;
}

HPDevice *a;

Expand Down

0 comments on commit 11a48a0

Please sign in to comment.