Bug 497832: Restore const keyword on char*s in nsMyTrustedEVInfo struct, to reduce compiler spam. r=kaie

This commit is contained in:
Daniel Holbert 2009-06-13 22:09:38 -07:00
Родитель 59bfeb371e
Коммит 81ff957c42
1 изменённых файлов: 11 добавлений и 10 удалений

Просмотреть файл

@ -70,13 +70,13 @@ NSSCleanupAutoPtrClass_WithParam(SECItem, SECITEM_FreeItem, TrueParam, PR_TRUE)
struct nsMyTrustedEVInfo struct nsMyTrustedEVInfo
{ {
char *dotted_oid; const char *dotted_oid;
char *oid_name; // Set this to null to signal an invalid structure, const char *oid_name; // Set this to null to signal an invalid structure,
// (We can't have an empty list, so we'll use a dummy entry) // (We can't have an empty list, so we'll use a dummy entry)
SECOidTag oid_tag; SECOidTag oid_tag;
char *ev_root_sha1_fingerprint; const char *ev_root_sha1_fingerprint;
char *issuer_base64; const char *issuer_base64;
char *serial_base64; const char *serial_base64;
CERTCertificate *cert; CERTCertificate *cert;
}; };
@ -454,11 +454,12 @@ nsMyTrustedEVInfoClass::nsMyTrustedEVInfoClass()
nsMyTrustedEVInfoClass::~nsMyTrustedEVInfoClass() nsMyTrustedEVInfoClass::~nsMyTrustedEVInfoClass()
{ {
free(dotted_oid); // Cast away const-ness in order to free these strings
free(oid_name); free(const_cast<char*>(dotted_oid));
free(ev_root_sha1_fingerprint); free(const_cast<char*>(oid_name));
free(issuer_base64); free(const_cast<char*>(ev_root_sha1_fingerprint));
free(serial_base64); free(const_cast<char*>(issuer_base64));
free(const_cast<char*>(serial_base64));
if (cert) if (cert)
CERT_DestroyCertificate(cert); CERT_DestroyCertificate(cert);
} }