diff -ruNp curl-7.19.5.orig/lib/nss.c curl-7.19.5/lib/nss.c --- curl-7.19.5.orig/lib/nss.c 2009-07-10 13:54:34.592293130 +0200 +++ curl-7.19.5/lib/nss.c 2009-07-10 13:54:48.250293559 +0200 @@ -856,9 +856,17 @@ void Curl_nss_cleanup(void) * as a safety feature. */ PR_Lock(nss_initlock); + + /* Free references to client certificates held in the SSL session cache. + * Omitting this hampers destruction of the security module owning + * the certificates. */ + SSL_ClearSessionCache(); + if (initialized) { - if(mod) + if(mod) { + SECMOD_UnloadUserModule(mod); SECMOD_DestroyModule(mod); + } mod = NULL; NSS_Shutdown(); }