Don't close or free (it wasn't allocated) the certdb.

2001-05-15  Jeffrey Stedfast  <fejj@ximian.com>

	* camel-smime-context.c (camel_smime_context_finalise): Don't
	close or free (it wasn't allocated) the certdb.
	(camel_smime_context_new): If we get a NULL certdb handle, then
	don't bother trying to create a new certdb handle since NSS_Init*
	should have done that.

svn path=/trunk/; revision=9830
This commit is contained in:
Jeffrey Stedfast
2001-05-15 20:14:00 +00:00
committed by Jeffrey Stedfast
parent d706eb2e77
commit 4e4a41d8ae
2 changed files with 11 additions and 13 deletions

View File

@ -1,3 +1,11 @@
2001-05-15 Jeffrey Stedfast <fejj@ximian.com>
* camel-smime-context.c (camel_smime_context_finalise): Don't
close or free (it wasn't allocated) the certdb.
(camel_smime_context_new): If we get a NULL certdb handle, then
don't bother trying to create a new certdb handle since NSS_Init*
should have done that.
2001-05-15 Jeffrey Stedfast <fejj@ximian.com>
* Makefile.am: Don't use EXTRA_GNOME_*, use the new CAMEL_*

View File

@ -76,9 +76,6 @@ camel_smime_context_finalise (CamelObject *o)
{
CamelSMimeContext *context = (CamelSMimeContext *)o;
CERT_ClosePermCertDB (context->priv->certdb);
g_free (context->priv->certdb);
g_free (context->priv);
}
@ -141,16 +138,9 @@ camel_smime_context_new (CamelSession *session, const char *certdb)
camel_cipher_context_construct (CAMEL_CIPHER_CONTEXT (context), session);
handle = CERT_CertGetDefaultCertDBHandle ();
if (certdb) {
if (!CERT_OpenCertDBFilename (handle, (char *) certdb, FALSE)) {
g_free (handle);
return NULL;
}
} else {
if (!CERT_OpenVolatileCertDB (handle)) {
g_free (handle);
return NULL;
}
if (!certdb) {
camel_object_unref (CAMEL_OBJECT (context));
return NULL;
}
context->priv->certdb = handle;