projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7188540
)
ash: do not let EXIT trap to fire in `trap`
author
Denys Vlasenko
<vda.linux@googlemail.com>
Thu, 24 Sep 2009 01:09:26 +0000
(
03:09
+0200)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Thu, 24 Sep 2009 01:09:26 +0000
(
03:09
+0200)
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
shell/ash.c
patch
|
blob
|
history
diff --git
a/shell/ash.c
b/shell/ash.c
index 597bc2808b1c86546d53086850de7588067038a9..47f968b5474141dfcef3f5b4c2c2b171177653cd 100644
(file)
--- a/
shell/ash.c
+++ b/
shell/ash.c
@@
-4525,7
+4525,7
@@
clear_traps(void)
INT_OFF;
free(*tp);
*tp = NULL;
- if (
tp != &trap[0]
)
+ if (
(tp - trap) != 0
)
setsignal(tp - trap);
INT_ON;
}
@@
-4596,6
+4596,8
@@
forkchild(struct job *jp, union node *n, int mode)
*
* Our solution: ONLY bare $(trap) or `trap` is special.
*/
+ free(trap[0]); /* Prevent EXIT trap from firing in `trap` */
+ trap[0] = NULL;
} else {
clear_traps();
}
@@
-13023,6
+13025,7
@@
exitshell(void)
if (p) {
trap[0] = NULL;
evalstring(p, 0);
+ free(p);
}
flush_stdout_stderr();
out: