]> git.saurik.com Git - apple/xnu.git/blobdiff - bsd/security/audit/audit_mac.c
xnu-7195.101.1.tar.gz
[apple/xnu.git] / bsd / security / audit / audit_mac.c
index 18567474f85a982bb23fcec6908cbb6b855835f8..82f9b256d1035c4caccb14783d56e7f89b407058 100644 (file)
@@ -85,7 +85,10 @@ audit_mac_new(proc_t p, struct kaudit_record *ar)
        }
        mac.m_buflen = MAC_AUDIT_LABEL_LEN;
        mac.m_string = ar->k_ar.ar_cred_mac_labels;
-       mac_cred_label_externalize_audit(p, &mac);
+       if (mac_cred_label_externalize_audit(p, &mac)) {
+               zfree(audit_mac_label_zone, ar->k_ar.ar_cred_mac_labels);
+               return 1;
+       }
 
        /*
         * grab space for the reconds.