From: Richard Russon Date: Thu, 16 Feb 2017 12:43:39 +0000 (+0000) Subject: fix: resource leak - CID 76984 X-Git-Tag: neomutt-20170225~14^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dd3139212707414dd1136f840add6843c926be7f;p=neomutt fix: resource leak - CID 76984 --- diff --git a/edit.c b/edit.c index df6ae460f..38e1b542f 100644 --- a/edit.c +++ b/edit.c @@ -441,7 +441,7 @@ int mutt_builtin_editor (const char *path, HEADER *msg, HEADER *cur) case 'v': if (be_barf_file (path, buf, buflen) == 0) { - char *tag, *err; + char *tag = NULL, *err = NULL; be_free_memory (buf, buflen); buf = NULL; bufmax = buflen = 0; @@ -452,6 +452,8 @@ int mutt_builtin_editor (const char *path, HEADER *msg, HEADER *cur) mutt_edit_headers (NONULL(Visual), path, msg, NULL, 0); if (mutt_env_to_intl (msg->env, &tag, &err)) printw (_("Bad IDN in %s: '%s'\n"), tag, err); + /* tag is a statically allocated string and should not be freed */ + FREE(&err); } else mutt_edit_file (NONULL(Visual), path);