opnsense-src/tools/regression/bin/sh/execution/func1.0
Jilles Tjoelker f6d21b6ed0 MFC r196483,r196634:
sh: Fix crash when undefining or redefining a currently executing function

Add a reference count to function definitions.
Memory may leak if a SIGINT arrives in interactive mode at exactly the wrong
time, this will be fixed later by changing SIGINT handling.

PR:		bin/137640
Approved by:	re (kib)
2009-10-11 16:35:12 +00:00

4 lines
118 B
Text

# $FreeBSD$
MALLOC_OPTIONS=J sh -c 'g() { g() { :; }; :; }; g' &&
MALLOC_OPTIONS=J sh -c 'g() { unset -f g; :; }; g'