just allocate the memory for c before checking c==null