Guard against NULL CFRelease() on failure condition in fallback path (#2867)

This was caught by analysis for XPC validation path. This is very unlikely to be hit practically.
This commit is contained in:
Zorg authored and GitHub committed 2026-04-26 14:50:32 -07:00
1 parent 066e75a8b3
commit 1520cda1bd
1 file changed
+3 -1
+3 -1
View File
@@ -471,7 +471,9 @@ finally:
SecCodeRef code = NULL;
OSStatus result = SecCodeCopyGuestWithAttributes(NULL, (__bridge CFDictionaryRef _Nullable)(attributes), kSecCSDefaultFlags, &code);
if (result != errSecSuccess) {
CFRelease(code);
if (code != NULL) {
CFRelease(code);
}
if (error != NULL) {
*error = [NSError errorWithDomain:SUSparkleErrorDomain code:SUInsufficientSigningError userInfo:@{ NSLocalizedDescriptionKey: [NSString stringWithFormat:@"The client connection could not be validated because SecCodeCopyGuestWithAttributes() failed with error %d", result] }];