procstat: fix a crash with -k -a options

The traditional / legacy usage should still be supported.
This fixes a regression in r324619 that introduced a nicer, verb based
interface.

Reviewed by:	brooks
X-MFC with:	r324619
This commit is contained in:
Andriy Gapon 2017-11-16 22:14:49 +00:00
parent a3c15a4445
commit 6effb21323

View File

@ -296,7 +296,7 @@ main(int argc, char *argv[])
cmd = getcmd("tsignals");
break;
case 'k':
if (cmd->cmd == procstat_kstack) {
if (cmd != NULL && cmd->cmd == procstat_kstack) {
if ((procstat_opts & PS_OPT_VERBOSE) != 0)
usage();
procstat_opts |= PS_OPT_VERBOSE;