talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 0c330bd1e1f5ce77e160f46f06ba3431bbc5d921
parent 8101fa7f5c1e01f3d7b9e2aa6873cf490f610a7b
Author: Andrej Kacian <ticho@claws-mail.org>
Date:   Tue, 23 Apr 2019 23:58:22 +0200

Fix memory leaks in pgpmime_sign() and pgpmime_encrypt()

Diffstat:
Msrc/plugins/pgpmime/pgpmime.c | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/plugins/pgpmime/pgpmime.c b/src/plugins/pgpmime/pgpmime.c @@ -601,6 +601,7 @@ gboolean pgpmime_sign(MimeInfo *mimeinfo, PrefsAccount *account, const gchar *fr newinfo->data.mem = g_malloc(len + 1); g_memmove(newinfo->data.mem, sigcontent, len); newinfo->data.mem[len] = '\0'; + newinfo->tmp = TRUE; g_node_append(sigmultipart->node, newinfo->node); g_free(sigcontent); @@ -736,6 +737,7 @@ gboolean pgpmime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data) newinfo->subtype = g_strdup("pgp-encrypted"); newinfo->content = MIMECONTENT_MEM; newinfo->data.mem = g_strdup("Version: 1\n"); + newinfo->tmp = TRUE; g_node_append(encmultipart->node, newinfo->node); newinfo = procmime_mimeinfo_new(); @@ -743,6 +745,7 @@ gboolean pgpmime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data) newinfo->subtype = g_strdup("octet-stream"); newinfo->content = MIMECONTENT_MEM; newinfo->data.mem = g_malloc(len + 1); + newinfo->tmp = TRUE; g_memmove(newinfo->data.mem, enccontent, len); newinfo->data.mem[len] = '\0'; g_node_append(encmultipart->node, newinfo->node);