diff options
-rw-r--r-- | usr.bin/procstat/procstat_files.c | 2 | ||||
-rw-r--r-- | usr.bin/procstat/procstat_vm.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/usr.bin/procstat/procstat_files.c b/usr.bin/procstat/procstat_files.c index 1f620f3..74ec590 100644 --- a/usr.bin/procstat/procstat_files.c +++ b/usr.bin/procstat/procstat_files.c @@ -144,6 +144,8 @@ procstat_files(pid_t pid, struct kinfo_proc *kipp) "PRO", "NAME"); freep = kinfo_getfile(pid, &cnt); + if (freep == NULL) + return; for (i = 0; i < cnt; i++) { kif = &freep[i]; diff --git a/usr.bin/procstat/procstat_vm.c b/usr.bin/procstat/procstat_vm.c index 79c0e57..1873c4f 100644 --- a/usr.bin/procstat/procstat_vm.c +++ b/usr.bin/procstat/procstat_vm.c @@ -54,6 +54,8 @@ procstat_vm(pid_t pid, struct kinfo_proc *kipp __unused) "PRES", "REF", "SHD", "FL", "TP", "PATH"); freep = kinfo_getvmmap(pid, &cnt); + if (freep == NULL) + return; for (i = 0; i < cnt; i++) { kve = &freep[i]; printf("%5d ", pid); |