From 79741a49d9b5c3ff76aa878c3f6ab82d090539a4 Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Tue, 6 Nov 2018 11:02:01 -0800 Subject: [PATCH] Fix a few memory leaks for idna conversion. --- alias.c | 1 + init.c | 5 ++++- sendlib.c | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/alias.c b/alias.c index 458461df..da1db062 100644 --- a/alias.c +++ b/alias.c @@ -305,6 +305,7 @@ retry_name: if (mutt_addrlist_to_intl (new->addr, &err)) { mutt_error (_("Error: '%s' is a bad IDN."), err); + FREE (&err); mutt_sleep (2); continue; } diff --git a/init.c b/init.c index 1db9a549..e5c78961 100644 --- a/init.c +++ b/init.c @@ -1077,9 +1077,11 @@ static int parse_group (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) if ((addr = mutt_parse_adrlist (NULL, buf->data)) == NULL) goto bail; if (mutt_addrlist_to_intl (addr, &estr)) - { + { snprintf (err->data, err->dsize, _("%sgroup: warning: bad IDN '%s'.\n"), data == 1 ? "un" : "", estr); + FREE (&estr); + rfc822_free_address (&addr); goto bail; } if (data == MUTT_GROUP) @@ -1543,6 +1545,7 @@ static int parse_alias (BUFFER *buf, BUFFER *s, unsigned long data, BUFFER *err) { snprintf (err->data, err->dsize, _("Warning: Bad IDN '%s' in alias '%s'.\n"), estr, tmp->name); + FREE (&estr); goto bail; } diff --git a/sendlib.c b/sendlib.c index b1e9ea54..2128c94e 100644 --- a/sendlib.c +++ b/sendlib.c @@ -2650,7 +2650,7 @@ int mutt_bounce_message (FILE *fp, HEADER *h, ADDRESS *to) const char *fqdn = mutt_fqdn (1); char resent_from[STRING]; int ret; - char *err; + char *err = NULL; resent_from[0] = '\0'; from = mutt_default_from (); @@ -2673,6 +2673,7 @@ int mutt_bounce_message (FILE *fp, HEADER *h, ADDRESS *to) { mutt_error (_("Bad IDN %s while preparing resent-from."), err); + FREE (&err); rfc822_free_address (&from); return -1; } -- 2.40.0