From: Richard Russon Date: Thu, 16 Feb 2017 12:46:47 +0000 (+0000) Subject: fix: resource leak - CID 76967 X-Git-Tag: neomutt-20170225~14^2~17 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f18fd773f9391f89c090ae599c3b88d0934069c7;p=neomutt fix: resource leak - CID 76967 --- diff --git a/pgp.c b/pgp.c index ab613631b..a88bf9ffa 100644 --- a/pgp.c +++ b/pgp.c @@ -395,6 +395,7 @@ int pgp_application_pgp_handler (BODY *m, STATE *s) if ((tmpfp = safe_fopen (tmpfname, "w+")) == NULL) { mutt_perror (tmpfname); + FREE(&gpgcharset); return -1; } @@ -416,6 +417,7 @@ int pgp_application_pgp_handler (BODY *m, STATE *s) if (mutt_strncmp ("Charset: ", buf, 9) == 0) { size_t l = 0; + FREE(&gpgcharset); gpgcharset = safe_strdup (buf + 9); if ((l = mutt_strlen (gpgcharset)) > 0 && gpgcharset[l-1] == '\n') gpgcharset[l-1] = 0; @@ -435,6 +437,7 @@ int pgp_application_pgp_handler (BODY *m, STATE *s) { mutt_perror (outfile); safe_fclose (&tmpfp); + FREE(&gpgcharset); return -1; }