freebsd-nq/bin/sh
Jilles Tjoelker d3eae2a68e sh: Fix rare memory leak with SIGINT
If getcwd() failed earlier on but later succeeded in the pwd builtin,
there was no INTOFF protection between calling savestr() and storing its
result.

It is quite rare for getcwd() to fail, and rarer for it to succeed later in
the same directory.

Found via code inspection for changing ckmalloc() and similar to assert
INTOFF protection instead of applying it directly (which protects against
corrupting malloc's internal state but allows memory leaks or double frees).

MFC after:	1 week
2020-01-01 12:06:37 +00:00
..
bltin
funcs
tests
alias.c
alias.h
arith_yacc.c
arith_yacc.h
arith_yylex.c
arith.h
builtins.def
cd.c sh: Fix rare memory leak with SIGINT 2020-01-01 12:06:37 +00:00
cd.h
dot.profile
dot.shrc
error.c
error.h
eval.c
eval.h
exec.c
exec.h
expand.c
expand.h
histedit.c
input.c
input.h
jobs.c
jobs.h
mail.c
mail.h
main.c
main.h
Makefile
Makefile.depend
memalloc.c
memalloc.h
miscbltin.c
mkbuiltins
mknodes.c
mksyntax.c
mktokens
myhistedit.h
mystring.c
mystring.h
nodes.c.pat
nodetypes
options.c
options.h
output.c
output.h
parser.c
parser.h
profile
redir.c
redir.h
sh.1
shell.h
show.c
show.h
TOUR
trap.c
trap.h
var.c
var.h