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 e14ebe0..8dc761d 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);
 
        /* 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);
        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);
 
        /* read temporary file into memory */
        textstr = get_canonical_content(fp, boundary);
 
+       g_free(boundary);
        fclose(fp);
 
        /* encrypt data */
        fclose(fp);
 
        /* encrypt data */