sh: Fix swapped INTON/INTOFF.

A possible consequence of this bug was a memory leak if SIGINT arrived
during a 'set' command (listing variables).

MFC after:	1 week
This commit is contained in:
Jilles Tjoelker 2012-02-04 23:29:07 +00:00
parent 761d31e8bf
commit 33233ec76e

View File

@ -603,7 +603,7 @@ showvarscmd(int argc __unused, char **argv __unused)
}
}
INTON;
INTOFF;
vars = ckmalloc(n * sizeof(*vars));
i = 0;
for (vpp = vartab; vpp < vartab + VTABSIZE; vpp++) {
@ -628,7 +628,7 @@ showvarscmd(int argc __unused, char **argv __unused)
out1c('\n');
}
ckfree(vars);
INTOFF;
INTON;
return 0;
}