From 49a94e2bab1e4f601a9fbdf9615d9e4e0150e412 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Sun, 28 Nov 2010 21:09:51 +0800 Subject: [EXPAND] Free IFS state in evalbackcmd On Sun, Nov 07, 2010 at 04:04:20PM -0600, Jonathan Nieder wrote: > > Herbert Xu wrote: > > > commit f42e443bb511ed3224f09b4fcf0772438ebdbbfa > > Author: Herbert Xu > > Date: Wed Sep 8 20:07:26 2010 +0800 > > > > [EXPAND] Fix ifsfirst/ifslastp leak > > Another puzzle bisecting to f42e443bb. This one comes from the > grub-mkconfig script: > > $ sh -c 'datadir=/usr/share; pkgdatadir=${datadir}/`cat`' 2>&1 | cat -A > cat: M-^\^M^F^HM-4^M^F^HM-(^M^F^H: No such file or directory$ > cat: M-(^M^F^H: No such file or directory$ > > Still reproducible with 016b529. I'll try to find time to look into > it, but thought you might like to know nevertheless. This is the symptom of another leak. In this case evalbackcmd occurs in the middle of an expansion (as it should) but the forked child never clears the previous IFS state. This patch adds the missing ifsfree call. This wasn't as much of a problem as the previously discovered leaks since all it means is that the child gets to carry around the parent's expansion state and the child is usually short-lived. Reported-by: Jonathan Nieder Signed-off-by: Herbert Xu --- ChangeLog | 1 + src/eval.c | 1 + 2 files changed, 2 insertions(+) diff --git a/ChangeLog b/ChangeLog index 13572bf..d0a8304 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,7 @@ * Fixed trap/return regression due to SKIPEVAL removal. * Allow the originator of EXERROR to set the exit status. + * Free IFS state in evalbackcmd. 2010-10-18 Herbert Xu diff --git a/src/eval.c b/src/eval.c index 64aabb1..6e5c43e 100644 --- a/src/eval.c +++ b/src/eval.c @@ -625,6 +625,7 @@ evalbackcmd(union node *n, struct backcmd *result) dup2(pip[1], 1); close(pip[1]); } + ifsfree(); evaltreenr(n, EV_EXIT); /* NOTREACHED */ } -- cgit 1.4.1 /src/log/home/.gdbinit?id=0362a9ccb07a4c7a3cd3fef6b7e23d6f999ee9d5&follow=1'>.gdbinit (unfollow)
Commit message (Expand)Author
2021-09-23Allow FocusEvents in xtermJune McEnroe
2021-09-23Use NI_NUMERICSERVJune McEnroe
2021-09-23Make up build away from FreeBSDJune McEnroe
2021-09-23Add quickJune McEnroe
2021-09-23Add The HobbitJune McEnroe
2021-09-22Remove PSF fontsJune McEnroe
2021-09-22Remove Linux-specific utilitiesJune McEnroe
2021-09-22Call sandbox in CGI modeJune McEnroe
2021-09-22Support HTTP PUT in upJune McEnroe
2021-09-22Remove default faviconJune McEnroe
2021-09-21Use Z_FILTERED strategyJune McEnroe
2021-09-21Recalculate various lengths only as neededJune McEnroe
2021-09-21Rewrite pngo, add explicit optionsJune McEnroe
2021-09-16Fix /* **/ comment matchingJune McEnroe
2021-09-15Remove typer, add downgrade to READMEJune McEnroe
2021-09-15Set bot mode on downgradeJune McEnroe
2021-09-15Enter capsicum in downgradeJune McEnroe
2021-09-15Factor out common parts of downgrade messagesJune McEnroe
2021-09-14Add downgrade IRC botJune McEnroe
2021-09-14Sort by title if authors matchJune McEnroe
2021-09-13Swap-remove tags as they're foundJune McEnroe
2021-09-12Replace htagml regex with strncmpJune McEnroe
2021-09-11Also defer printing comment for lone close-parensJune McEnroe
2021-09-10Publish "git-comment"June McEnroe
2021-09-10Add git comment --pretty optionJune McEnroe
2021-09-08Defer printing comment if line is blank or closing braceJune McEnroe
2021-09-08Up default min-repeat to 30 linesJune McEnroe
2021-09-08Handle dirty lines in git-commentJune McEnroe
2021-09-08Document and install git-commentJune McEnroe
2021-09-08Add repeat and all options to git-commentJune McEnroe
2021-09-08Add group threshold to git-commentJune McEnroe