dm-lc.c: fix for a potential NULL pointer dereference

Memory allocation may fail, hence add a check before dereferencing
the pointer.

Signed-off-by: Kumar Amit Mehta <gmate.amit@gmail.com>