]> granicus.if.org Git - neomutt/commitdiff
Fix memory leak in smime.c.
authorKevin McCarthy <kevin@8t8.us>
Tue, 11 Dec 2018 23:29:57 +0000 (15:29 -0800)
committerRichard Russon <rich@flatcap.org>
Thu, 13 Dec 2018 23:07:37 +0000 (23:07 +0000)
smime_application_smime_handler() was not freeing the BODY returned by
smime_handle_entity().

ncrypt/smime.c

index c5887e347bdc1a3513bc29305dae5ed244076629..6a09bc4d1643a7b3f4dc4ffd4c37096bbbf1f5f0 100644 (file)
@@ -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;
 }
 
 /**