[sr-dev] git:5.1:977057fb: cdp: fix three coverity errors (ressource leaks and error checks)