Bug 922269: Document the ownership of the CERTCertificate objects in
CERTCertList. r=ryan.sleevi.
--- 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