changeset: 6723:b4de6941bbb9
user:      Kevin McCarthy <ke...@8t8.us>
date:      Tue Jul 12 17:46:09 2016 -0700
link:      http://dev.mutt.org/hg/mutt/rev/b4de6941bbb9

Fix BODY->charset memory leaks.

mutt_get_content_info() was directly setting charset without freeing the 
previous value.

mutt_free_body() was not freeing the charset.

diffs (22 lines):

diff -r 9378d21fc7fe -r b4de6941bbb9 muttlib.c
--- a/muttlib.c Mon Jul 11 18:36:21 2016 -0700
+++ b/muttlib.c Tue Jul 12 17:46:09 2016 -0700
@@ -178,6 +178,7 @@
     }
 
     FREE (&b->filename);
+    FREE (&b->charset);
     FREE (&b->content);
     FREE (&b->xtype);
     FREE (&b->subtype);
diff -r 9378d21fc7fe -r b4de6941bbb9 sendlib.c
--- a/sendlib.c Mon Jul 11 18:36:21 2016 -0700
+++ b/sendlib.c Tue Jul 12 17:46:09 2016 -0700
@@ -903,6 +903,7 @@
        mutt_canonical_charset (chsbuf, sizeof (chsbuf), tocode);
        mutt_set_parameter ("charset", chsbuf, &b->parameter);
       }
+      FREE (&b->charset);
       b->charset = fromcode;
       FREE (&tocode);
       safe_fclose (&fp);

Reply via email to