Fix memory leak in smime_sign() and forgotten removal of a temporary file in smime_en...
authorAndrej Kacian <ticho@claws-mail.org>
Tue, 23 Apr 2019 22:03:27 +0000 (00:03 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Sat, 4 May 2019 14:43:04 +0000 (16:43 +0200)
src/plugins/smime/smime.c

index f0cd96f4a45a5db5fb1f53b41d233c207adb871d..fd50f1e3ff5310588375c0a90c56b86647023e02 100644 (file)
@@ -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);