Plug memory leaks.

Coverity CID:	1087993, 1087992
Approved by:	re (marius)
Sponsored by:	FreeBSD Foundation
Fix memory overrun.

Coverity CID:	1092478
Approved by:	re (gjb)
Sponsored by:	FreeBSD Foundation
Plug memory leak.

Coverity CID:	1087991
Approved by:	re (gjb)
Sponsored by:	FreeBSD Foundation