Skip to content

Commit

Permalink
Merge pull request #1050 from RSilicon/return
Browse files Browse the repository at this point in the history
Return early if kvPairs is NULL
  • Loading branch information
zdohnal authored Sep 17, 2024
2 parents faf144f + 9c7b779 commit 8c60a87
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/usb-darwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -1894,6 +1894,8 @@ static CFStringRef copy_value_for_key(CFStringRef deviceID,
return NULL;

kvPairs = CFStringCreateArrayBySeparatingStrings(kCFAllocatorDefault, deviceID, CFSTR(";"));
if (!kvPairs)
return NULL;
max = CFArrayGetCount(kvPairs);

for (CFIndex idx = 0; idx < max; idx++)
Expand Down

0 comments on commit 8c60a87

Please sign in to comment.