]> git.saurik.com Git - apple/security.git/blobdiff - OSX/libsecurity_codesigning/lib/SecAssessment.cpp
Security-58286.20.16.tar.gz
[apple/security.git] / OSX / libsecurity_codesigning / lib / SecAssessment.cpp
index 2c1e06bdf6ce4ee8eed6390eae7db13866de4148..f3395e63b6a7318b7781c4b036ce29a6fc77f86d 100644 (file)
@@ -427,12 +427,7 @@ CFDictionaryRef SecAssessmentCopyUpdate(CFTypeRef target,
        CFRef<CFDictionaryRef> result;
 
        // make context exist and writable
-       CFMutableDictionaryRef mcontext;
-       if (context == NULL) {
-               mcontext = makeCFMutableDictionary();
-       } else {
-               mcontext = makeCFMutableDictionary(context);
-       }
+       CFRef<CFMutableDictionaryRef> mcontext = context ? makeCFMutableDictionary(context) : makeCFMutableDictionary();
        
        if (CFDictionaryGetValue(mcontext, kSecAssessmentUpdateKeyAuthorization) == NULL) {
                // no authorization passed in. Make an empty one in this context
@@ -468,7 +463,7 @@ CFDictionaryRef SecAssessmentCopyUpdate(CFTypeRef target,
        traceUpdate(target, context, result);
        return result.yield();
 
-       END_CSAPI_ERRORS1(false)
+       END_CSAPI_ERRORS1(NULL)
 }