From d9e0ae350457aa960080142635f8f9a46ed482df Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 28 Jul 2016 20:59:40 +0200 Subject: [PATCH] parser/glob.c, bug fix, access to already freed memory --- src/frontend/parser/glob.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/frontend/parser/glob.c b/src/frontend/parser/glob.c index 8323711fa..ac32b642a 100644 --- a/src/frontend/parser/glob.c +++ b/src/frontend/parser/glob.c @@ -74,7 +74,7 @@ cp_doglob(wordlist *wlist) s = cp_tildexpand(wl->wl_word); txfree(wl->wl_word); /* sjb - fix memory leak */ if (!s) - *wl->wl_word = '\0'; /* MW. We Con't touch tmalloc addres */ + wl->wl_word = copy(""); /* MW. We Con't touch tmalloc addres */ else wl->wl_word = s; }