From 5563763309077db8db57b6e0c3c636a6a5a0a1b5 Mon Sep 17 00:00:00 2001 From: Ralph Corderoy Date: Wed, 22 Mar 2017 14:47:18 +0000 Subject: [PATCH] Fix free(3) of unmalloc()'d string in whatnow's refile. `ref +foo' at comp(1)'s whatnow prompt was trying to free "+foo". Take a copy of the string so the later free works. Tom Rodman reported the problem to nmh-workers. Bug introduced in 3b6be5607a251a3a793e97382e251ce66ea2bca0. --- sbr/refile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbr/refile.c b/sbr/refile.c index 43ad908e..b3402cfe 100644 --- a/sbr/refile.c +++ b/sbr/refile.c @@ -29,7 +29,7 @@ refile (char **arg, char *file) if (arg) { while (*arg) - vec[vecp++] = *arg++; + vec[vecp++] = mh_xstrdup(*arg++); } vec[vecp] = NULL; -- 2.56.0