diff --git a/proc/sig.c b/proc/sig.c index 2191cda5..a93aabb9 100644 --- a/proc/sig.c +++ b/proc/sig.c @@ -261,7 +261,7 @@ char *strtosig(const char *restrict s){ } } } - free(p); + free(copy); return converted; } diff --git a/testsuite/kill.test/kill.exp b/testsuite/kill.test/kill.exp index 1668ac4f..211395c9 100644 --- a/testsuite/kill.test/kill.exp +++ b/testsuite/kill.test/kill.exp @@ -24,6 +24,10 @@ set test "kill convert signal name to number" spawn $kill -lHUP expect_pass "$test" "^1\\s*" +set test "kill convert SIG-prefixed signal name to number" +spawn $kill -lSIGHUP +expect_pass "$test" "^1\\s*$" + set test "kill convert signal number to name" spawn $kill -l 1 expect_pass "$test" "^HUP\\s*"