Following r222950, revert unintentional change cls -> class in argument name
in r245264.  Aside from non-uniformity, that again confused C++ compilers.
Add missing NULL check after malloc(M_NOWAIT).

Submitted by:	Dmitry Luhtionov <dmitryluhtionov@gmail.com>