Check for an allocation failure before dereferencing the pointer.
Reported by: Ilja Van Sprundel <ivansprundel@ioactive.com>
Reviewed by: np
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18310