]> granicus.if.org Git - mutt/commitdiff
Fix memory leak in smime.c.
authorKevin McCarthy <kevin@8t8.us>
Tue, 11 Dec 2018 23:29:57 +0000 (15:29 -0800)
committerKevin McCarthy <kevin@8t8.us>
Wed, 12 Dec 2018 20:41:30 +0000 (12:41 -0800)
smime_application_smime_handler() was not freeing the BODY returned by
smime_handle_entity().

smime.c

diff --git a/smime.c b/smime.c
index b13a91a36df944211c526de249fe8b668db89ee5..940c003b1a749423d153a4f95e5c4d30b441e2a7 100644 (file)
--- a/smime.c
+++ b/smime.c
@@ -2097,7 +2097,16 @@ bail:
 
 int smime_application_smime_handler (BODY *m, STATE *s)
 {
-  return smime_handle_entity (m, s, NULL) ? 0 : -1;
+  int rv = -1;
+  BODY *tattach;
+
+  tattach = smime_handle_entity (m, s, NULL);
+  if (tattach)
+  {
+    rv = 0;
+    mutt_free_body (&tattach);
+  }
+  return rv;
 }
 
 int smime_send_menu (HEADER *msg)