caif: fix a potential NULL dereference