parser/glob.c, bug fix, access to already freed memory

This commit is contained in:
rlar 2016-07-28 20:59:40 +02:00
parent a5817192e1
commit d9e0ae3504
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}