Fix for bug 72291 . resolve memory leak on nicknames . r=relyea

This commit is contained in:
jpierre%netscape.com 2003-09-05 00:15:52 +00:00
Родитель 16eee9d133
Коммит f886a5b696
1 изменённых файлов: 13 добавлений и 2 удалений

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

@ -3331,6 +3331,7 @@ pk11ListCertCallback(NSSCertificate *c, void *arg)
PRBool isUnique = PR_FALSE;
PRBool isCA = PR_FALSE;
char *nickname = NULL;
char *tmpnickname = NULL;
unsigned int certType;
if ((type == PK11CertListUnique) || (type == PK11CertListRootUnique)) {
@ -3370,7 +3371,12 @@ pk11ListCertCallback(NSSCertificate *c, void *arg)
if (isUnique) {
CERT_DupCertificate(newCert);
nickname = STAN_GetCERTCertificateName(c);
tmpnickname = STAN_GetCERTCertificateName(c);
if (tmpnickname) {
nickname = PORT_ArenaStrdup(certList->arena, tmpnickname);
PORT_Assert(nickname);
PORT_Free(tmpnickname);
}
/* put slot certs at the end */
if (newCert->slot && !PK11_IsInternal(newCert->slot)) {
@ -3392,7 +3398,12 @@ pk11ListCertCallback(NSSCertificate *c, void *arg)
/* put the same CERTCertificate in the list for all instances */
CERT_DupCertificate(newCert);
nickname = STAN_GetCERTCertificateNameForInstance(c, instance);
tmpnickname = STAN_GetCERTCertificateNameForInstance(c, instance);
if (tmpnickname) {
nickname = PORT_ArenaStrdup(certList->arena, tmpnickname);
PORT_Assert(nickname);
PORT_Free(tmpnickname);
}
/* put slot certs at the end */
if (slot && !PK11_IsInternal(slot)) {