function old new delta
changepath 194 195 +1
evalvar 1373 1371 -2
forkchild 602 590 -12
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
for (tp = trap; tp < &trap[NSIG]; tp++) {
if (*tp && **tp) { /* trap not NULL or "" (SIG_IGN) */
INT_OFF;
- free(*tp);
+ if (trap_ptr == trap)
+ free(*tp);
+ /* else: it "belongs" to trap_ptr vector, don't free */
*tp = NULL;
if ((tp - trap) != 0)
setsignal(tp - trap);
/* This is needed to prevent EXIT trap firing and such
* (trap_ptr will be freed in trapcmd()) */
trap_ptr = memcpy(xmalloc(sizeof(trap)), trap, sizeof(trap));
- memset(trap, 0, sizeof(trap));
- } else {
- clear_traps();
}
+ clear_traps();
#if JOBS
/* do job control only in root shell */
doing_jobctl = 0;