HomeFreeBSD

Fix up pointer issues with lib/libkvm

Description

Fix up pointer issues with lib/libkvm

In particular,

  • avoid dereferencing NULL pointers
  • test pointers against NULL, not 0
  • test for errout == NULL in the top-level functions (kvm_open, kvm_openfiles, kvm_open2, etc)
  • Replace a realloc and free on failure with reallocf

Found with: devel/cocchinelle

Differential Revision: https://reviews.freebsd.org/D5954
MFC after: 1 week
Reviewed by: jhb
Sponsored by: EMC / Isilon Storage Division

Details

Provenance
ngieAuthored on
Reviewer
jhb
Parents
rS298484: Optionally return the output capabilities list from _OSC.
Branches
Unknown
Tags
Unknown