From 4e4a41d8aefa57f9741d353eb9b6008a050e6419 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 15 May 2001 20:14:00 +0000 Subject: Don't close or free (it wasn't allocated) the certdb. 2001-05-15 Jeffrey Stedfast * 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 --- camel/ChangeLog | 8 ++++++++ camel/camel-smime-context.c | 16 +++------------- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/camel/ChangeLog b/camel/ChangeLog index ee85fe9f8f..be49f88dd1 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,11 @@ +2001-05-15 Jeffrey Stedfast + + * 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 * Makefile.am: Don't use EXTRA_GNOME_*, use the new CAMEL_* diff --git a/camel/camel-smime-context.c b/camel/camel-smime-context.c index 4b290ee139..8fa1a6cec3 100644 --- a/camel/camel-smime-context.c +++ b/camel/camel-smime-context.c @@ -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; -- cgit v1.2.3