[sr-dev] git:master:b3030a29: enum: free variable in case of error and safety check for returned pointer