Fixed leaking @"IOFireWireDevice", found by the Clang Static Analyzer.
authorPeter Hosey <hg@boredzo.org>
Sat Oct 10 12:26:06 2009 -0700 (2009-10-10)
changeset 4508ebe7f0a2ff4d
parent 4507 b5cd8c227a69
child 4509 714a3c623b46
Fixed leaking @"IOFireWireDevice", found by the Clang Static Analyzer.
Extras/HardwareGrowler/FireWireNotifier.c
     1.1 --- a/Extras/HardwareGrowler/FireWireNotifier.c	Sat Oct 10 12:24:03 2009 -0700
     1.2 +++ b/Extras/HardwareGrowler/FireWireNotifier.c	Sat Oct 10 12:26:06 2009 -0700
     1.3 @@ -22,8 +22,12 @@
     1.4  	CFStringRef tempDeviceName = CFStringCreateWithCString(kCFAllocatorDefault,
     1.5  														   deviceNameChars,
     1.6  														   kCFStringEncodingASCII);
     1.7 -	if (CFStringCompare(tempDeviceName, CFSTR("IOFireWireDevice"), 0) != kCFCompareEqualTo)
     1.8 -		return tempDeviceName;
     1.9 +	if (tempDeviceName) {
    1.10 +		if (CFStringCompare(tempDeviceName, CFSTR("IOFireWireDevice"), 0) != kCFCompareEqualTo)
    1.11 +			return tempDeviceName;
    1.12 +		else
    1.13 +			CFRelease(tempDeviceName);
    1.14 +	}
    1.15  
    1.16  	tempDeviceName = IORegistryEntrySearchCFProperty(thisObject,
    1.17  													 kIOFireWirePlane,