Skip to content

Commit

Permalink
Fix potential memory leak
Browse files Browse the repository at this point in the history
src/hotplug_macosx.c:165:3 Potential leak of an object stored into 'pluginUrl'

We should release pluginUrl _before_ the return.
  • Loading branch information
LudovicRousseau committed May 6, 2024
1 parent 582830f commit 061d59a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hotplug_macosx.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,12 +160,12 @@ static HPDriverVector HPDriversGetFromDirectory(const char *driverBundlePath)
}
bundleArray = CFBundleCreateBundlesFromDirectory(kCFAllocatorDefault,
pluginUrl, NULL);
CFRelease(pluginUrl);
if (!bundleArray)
{
Log1(PCSC_LOG_ERROR, "error getting plugin directory bundles");
return NULL;
}
CFRelease(pluginUrl);

size_t bundleArraySize = CFArrayGetCount(bundleArray);
size_t i;
Expand Down

0 comments on commit 061d59a

Please sign in to comment.