Fix minor buffer overflow reported by Coverity.

CID:		1006781


git-svn-id: svn+ssh://svn.freebsd.org/base/head@271352 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix memory leak on error, reported by Coverity.

CID:		1007773


git-svn-id: svn+ssh://svn.freebsd.org/base/head@271353 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Fix couple off-by-one range check errors, reported by Coverity.

CID:		1007837


git-svn-id: svn+ssh://svn.freebsd.org/base/head@271354 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f