cursor: check for memory allocation errors

Signed-off-by: U. Artie Eoff <ullysses.a.eoff@intel.com>