Pgpmime: fix two memory leak in MIME boundary handling.
authorAndrej Kacian <ticho@claws-mail.org>
Sun, 16 Jul 2017 17:31:25 +0000 (19:31 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Sun, 16 Jul 2017 17:31:25 +0000 (19:31 +0200)
src/plugins/pgpmime/pgpmime.c

index e14ebe0405473e34b9e6d6e89480c7d2a3732157..8dc761d1598d1a503a369524f2adfa30017e1a2d 100644 (file)
@@ -501,6 +501,7 @@ gboolean pgpmime_sign(MimeInfo *mimeinfo, PrefsAccount *account, const gchar *fr
        /* read temporary file into memory */
        textstr = get_canonical_content(fp, boundary);
 
+       g_free(boundary);
        fclose(fp);
 
        gpgme_data_new_from_mem(&gpgtext, textstr, (size_t)strlen(textstr), 0);
@@ -700,6 +701,7 @@ gboolean pgpmime_encrypt(MimeInfo *mimeinfo, const gchar *encrypt_data)
        /* read temporary file into memory */
        textstr = get_canonical_content(fp, boundary);
 
+       g_free(boundary);
        fclose(fp);
 
        /* encrypt data */