]> git.saurik.com Git - apple/security.git/blobdiff - OSX/Breadcrumb/bc-10-knife-on-bread.m
Security-57740.51.3.tar.gz
[apple/security.git] / OSX / Breadcrumb / bc-10-knife-on-bread.m
index 638eb72938fd896bd512107441afcef44f631aa9..a3f80db315245c3f180b914638638348e0c4b7d0 100644 (file)
@@ -25,6 +25,7 @@
 #include <Foundation/Foundation.h>
 #include <Security/Security.h>
 #include <Security/SecBreadcrumb.h>
+#include <utilities/SecCFRelease.h>
 
 #include "breadcrumb_regressions.h"
 
@@ -50,7 +51,7 @@ int bc_10_password(int argc, char *const *argv)
     ok(SecBreadcrumbCopyPassword(password, breadcrumb, encryptedKey, &oldPassword, NULL), "unwrap failed");
 
     ok(oldPassword && CFStringCompare(password, oldPassword, 0) == kCFCompareEqualTo, "not same password");
-    CFRelease(oldPassword);
+    CFReleaseSafe(oldPassword);
 
     CFDataRef newEncryptedKey;
 
@@ -66,9 +67,9 @@ int bc_10_password(int argc, char *const *argv)
     
     ok(oldPassword && CFStringCompare(password, oldPassword, 0) == kCFCompareEqualTo, "not same password");
 
-    CFRelease(breadcrumb);
-    CFRelease(oldPassword);
-    CFRelease(newEncryptedKey);
+    CFReleaseSafe(breadcrumb);
+    CFReleaseSafe(oldPassword);
+    CFReleaseSafe(newEncryptedKey);
 
     /*
      * Check KAT for IV less operation (version1)
@@ -81,9 +82,9 @@ int bc_10_password(int argc, char *const *argv)
 
     ok(oldPassword && CFStringCompare(password, oldPassword, 0) == kCFCompareEqualTo, "not same password");
 
-    CFRelease(breadcrumb);
-    CFRelease(oldPassword);
-    CFRelease(newEncryptedKey);
+    CFReleaseSafe(breadcrumb);
+    CFReleaseSafe(oldPassword);
+    CFReleaseSafe(newEncryptedKey);
 
     /*
      * Check KAT for IV less operation (version2)
@@ -96,9 +97,9 @@ int bc_10_password(int argc, char *const *argv)
 
     ok(oldPassword && CFStringCompare(password, oldPassword, 0) == kCFCompareEqualTo, "not same password");
 
-    CFRelease(breadcrumb);
-    CFRelease(oldPassword);
-    CFRelease(newEncryptedKey);
+    CFReleaseSafe(breadcrumb);
+    CFReleaseSafe(oldPassword);
+    CFReleaseSafe(newEncryptedKey);
 
     return 0;
 }