From: Kevin McCarthy Date: Tue, 11 Dec 2018 23:29:57 +0000 (-0800) Subject: Fix memory leak in smime.c. X-Git-Tag: 2019-10-25~439 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=565c9eb35e52cf29a65afdf82d8f5ba67c91aacf;p=neomutt Fix memory leak in smime.c. smime_application_smime_handler() was not freeing the BODY returned by smime_handle_entity(). --- diff --git a/ncrypt/smime.c b/ncrypt/smime.c index c5887e347..6a09bc4d1 100644 --- a/ncrypt/smime.c +++ b/ncrypt/smime.c @@ -2276,7 +2276,14 @@ bail: */ int smime_class_application_handler(struct Body *m, struct State *s) { - return smime_handle_entity(m, s, NULL) ? 0 : -1; + int rv = -1; + struct Body *tattach = smime_handle_entity (m, s, NULL); + if (tattach) + { + rv = 0; + mutt_body_free (&tattach); + } + return rv; } /**