*
* Our solution: ONLY bare $(trap) or `trap` is special.
*/
- /* This is needed to prevent EXIT trap firing and such
- * (trap_ptr will be freed in trapcmd()) */
+ /* This is needed to prevent EXIT trap firing and such */
trap_ptr = memcpy(xmalloc(sizeof(trap)), trap, sizeof(trap));
}
clear_traps();
single_quote(tr),
(signo == 0 ? "" : "SIG"),
get_signame(signo));
- if (trap_ptr != trap)
- free(tr);
+ /* trap_ptr != trap only if we are in special-cased `trap` code.
+ * In this case, we will exit very soon, no need to free(). */
+ /* if (trap_ptr != trap) */
+ /* free(tr); */
}
}
+ /*
if (trap_ptr != trap) {
free(trap_ptr);
trap_ptr = trap;
}
+ */
return 0;
}