commit fe13430b1687828b6b8c22672ea626dbd4812302
parent a534a94ff6a02d7e7a2e1a6f8e8463e40ae19dd9
Author: Andrej Kacian <ticho@claws-mail.org>
Date: Wed, 24 Apr 2019 00:03:27 +0200
Fix memory leak in smime_sign() and forgotten removal of a temporary file in smime_encrypt()
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/plugins/smime/smime.c b/src/plugins/smime/smime.c
@@ -691,6 +691,7 @@ gboolean smime_sign(MimeInfo *mimeinfo, PrefsAccount *account, const gchar *from
g_hash_table_insert(newinfo->dispositionparameters, g_strdup("filename"),
g_strdup("smime.p7s"));
newinfo->data.mem = g_malloc(len + 1);
+ newinfo->tmp = TRUE;
g_memmove(newinfo->data.mem, real_content, len);
newinfo->data.mem[len] = '\0';
newinfo->encoding_type = ENC_BASE64;
@@ -869,6 +870,7 @@ gboolean smime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
encmultipart->content = MIMECONTENT_FILE;
encmultipart->data.filename = tmpfile;
+ encmultipart->tmp = TRUE;
procmime_encode_content(encmultipart, ENC_BASE64);
g_free(enccontent);