Add missing NULL checking to prevent NULL pointer dereference if calloc failed. Signed-off-by: Axel Lin <axel.lin@gmail.com>