Bug 922269: Document the ownership of the CERTCertificate objects in
authorWan-Teh Chang <wtc@google.com>
Wed, 09 Oct 2013 15:51:48 -0700
changeset 10869 41112f4893862f3a97b377d2105d129fc04a1bf1
parent 10868 741d64d4656cec4bd4d3ac1e1580aba564de4461
child 10870 5349343fa84ab637a673776b9a5d5fa2692ac47a
push id172
push userwtc@google.com
push dateWed, 09 Oct 2013 22:51:58 +0000
bugs922269
Bug 922269: Document the ownership of the CERTCertificate objects in CERTCertList. r=ryan.sleevi.
lib/certdb/cert.h
--- a/lib/certdb/cert.h
+++ b/lib/certdb/cert.h
@@ -1213,33 +1213,44 @@ CERTCertList *
 CERT_MatchUserCert(CERTCertDBHandle *handle,
 		   SECCertUsage usage,
 		   int nCANames, char **caNames,
 		   void *proto_win);
 
 CERTCertList *
 CERT_NewCertList(void);
 
+/* free the cert list and all the certs in the list */
 void
 CERT_DestroyCertList(CERTCertList *certs);
 
 /* remove the node and free the cert */
 void
 CERT_RemoveCertListNode(CERTCertListNode *node);
 
+/* equivalent to CERT_AddCertToListTailWithData(certs, cert, NULL) */
 SECStatus
 CERT_AddCertToListTail(CERTCertList *certs, CERTCertificate *cert);
 
+/* equivalent to CERT_AddCertToListHeadWithData(certs, cert, NULL) */
 SECStatus
 CERT_AddCertToListHead(CERTCertList *certs, CERTCertificate *cert);
 
+/*
+ * The new cert list node takes ownership of "cert". "cert" is freed
+ * when the list node is removed.
+ */
 SECStatus
 CERT_AddCertToListTailWithData(CERTCertList *certs, CERTCertificate *cert,
 							 void *appData);
 
+/*
+ * The new cert list node takes ownership of "cert". "cert" is freed
+ * when the list node is removed.
+ */
 SECStatus
 CERT_AddCertToListHeadWithData(CERTCertList *certs, CERTCertificate *cert,
 							 void *appData);
 
 typedef PRBool (* CERTSortCallback)(CERTCertificate *certa,
 				    CERTCertificate *certb,
 				    void *arg);
 SECStatus