diff --git a/backend/usb-darwin.c b/backend/usb-darwin.c index 023e8a65a..5040c604e 100644 --- a/backend/usb-darwin.c +++ b/backend/usb-darwin.c @@ -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++)