HomeFreeBSD

Fix memory allocation edgecases in kvm_argv(..)

Description

Fix memory allocation edgecases in kvm_argv(..)

  • Don't leak nbufp on realloc failure in kvm_argv
  • Catch malloc errors with bufp
  • Set buflen last in the "buflen == 0" case to ensure that bufp/nbufp is properly reallocated on the next go around

Differential Revision: https://reviews.freebsd.org/D6051
MFC after: 1 week
Reviewed by: jhb, markj
Reported by: cppcheck
Sponsored by: EMC / Isilon Storage Division

Details

Provenance
ngieAuthored on
Reviewer
jhb
Parents
rS298838: Revert AccessWidth/BitOffset support for AcpiHwWrite() and AcpiHwRead() for
Branches
Unknown
Tags
Unknown