[evolution-data-server] [CamelSMIMEContext] Fix a memory leak
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] [CamelSMIMEContext] Fix a memory leak
- Date: Wed, 4 Jul 2018 10:14:12 +0000 (UTC)
commit 749e05357876a659a24f9540a7bdc02b0f421a76
Author: Milan Crha <mcrha redhat com>
Date: Wed Jul 4 12:13:24 2018 +0200
[CamelSMIMEContext] Fix a memory leak
src/camel/camel-smime-context.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
---
diff --git a/src/camel/camel-smime-context.c b/src/camel/camel-smime-context.c
index 4761c32d3..c784af576 100644
--- a/src/camel/camel-smime-context.c
+++ b/src/camel/camel-smime-context.c
@@ -1553,10 +1553,22 @@ fail:
return valid;
}
+static void
+camel_smime_context_finalize (GObject *object)
+{
+ CamelSMIMEContext *smime = CAMEL_SMIME_CONTEXT (object);
+
+ g_free (smime->priv->encrypt_key);
+
+ /* Chain up to parent's method. */
+ G_OBJECT_CLASS (camel_smime_context_parent_class)->finalize (object);
+}
+
static void
camel_smime_context_class_init (CamelSMIMEContextClass *class)
{
CamelCipherContextClass *cipher_context_class;
+ GObjectClass *object_class;
g_type_class_add_private (class, sizeof (CamelSMIMEContextPrivate));
@@ -1570,6 +1582,9 @@ camel_smime_context_class_init (CamelSMIMEContextClass *class)
cipher_context_class->verify_sync = smime_context_verify_sync;
cipher_context_class->encrypt_sync = smime_context_encrypt_sync;
cipher_context_class->decrypt_sync = smime_context_decrypt_sync;
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->finalize = camel_smime_context_finalize;
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]