From: Kevin McCarthy Date: Wed, 13 Jul 2016 00:46:09 +0000 (-0700) Subject: Fix BODY->charset memory leaks. X-Git-Tag: neomutt-20160822~79 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5853c1b41e74bddc5ef20e3af6b1295c02bfe23f;p=neomutt 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. --- diff --git a/muttlib.c b/muttlib.c index aed6d5649..7cf062574 100644 --- a/muttlib.c +++ b/muttlib.c @@ -178,6 +178,7 @@ void mutt_free_body (BODY **p) } FREE (&b->filename); + FREE (&b->charset); FREE (&b->content); FREE (&b->xtype); FREE (&b->subtype); diff --git a/sendlib.c b/sendlib.c index 939919caf..8b96ce78d 100644 --- a/sendlib.c +++ b/sendlib.c @@ -903,6 +903,7 @@ CONTENT *mutt_get_content_info (const char *fname, BODY *b) 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);