Fix some CID issues

- fix dereference null return value
. silence CID COPY_PASTE_ERROR warning