зеркало из https://github.com/mozilla/pjs.git
Fix leak of cert reference in cert authentication callback functions.
This commit is contained in:
Родитель
6a0b2fa90f
Коммит
eb25bb6dde
|
@ -140,6 +140,7 @@ myAuthCertificate(void *arg, PRFileDesc *socket,
|
|||
|
||||
/* If this is a server, we're finished. */
|
||||
if (isServer || secStatus != SECSuccess) {
|
||||
CERT_DestroyCertificate(cert);
|
||||
return secStatus;
|
||||
}
|
||||
|
||||
|
@ -162,6 +163,7 @@ myAuthCertificate(void *arg, PRFileDesc *socket,
|
|||
if (hostName)
|
||||
PR_Free(hostName);
|
||||
|
||||
CERT_DestroyCertificate(cert);
|
||||
return secStatus;
|
||||
}
|
||||
|
||||
|
|
|
@ -276,6 +276,7 @@ mySSLAuthCertificate(void *arg, PRFileDesc *fd, PRBool checkSig,
|
|||
FPRINTF(stderr, "selfserv: -- SSL3: Certificate Invalid, err %d.\n%s\n",
|
||||
err, SECU_Strerror(err));
|
||||
}
|
||||
CERT_DestroyCertificate(peerCert);
|
||||
FLUSH;
|
||||
return rv;
|
||||
}
|
||||
|
|
|
@ -213,6 +213,7 @@ mySSLAuthCertificate(void *arg, PRFileDesc *fd, PRBool checkSig,
|
|||
if (rv == SECSuccess) {
|
||||
fputs("strsclnt: -- SSL: Server Certificate Validated.\n", stderr);
|
||||
}
|
||||
CERT_DestroyCertificate(peerCert);
|
||||
/* error, if any, will be displayed by the Bad Cert Handler. */
|
||||
return rv;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче