Skip to content

Commit

Permalink
[process][freebsd]: add nil check on kInfoProc
Browse files Browse the repository at this point in the history
  • Loading branch information
shirou committed May 23, 2024
1 parent 8912445 commit 5fa412c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions process/process_freebsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ package process
import (
"bytes"
"context"
"fmt"
"path/filepath"
"strconv"
"strings"
Expand Down Expand Up @@ -338,5 +339,9 @@ func (p *Process) getKProc() (*KinfoProc, error) {
if err != nil {
return nil, err
}
if &k == nil {
return nil, fmt.Errorf("kInfoProc is nil")
}

return &k, nil
}

0 comments on commit 5fa412c

Please sign in to comment.