Согласно "CFError.h", где определен CFErrorRef: то есть
typedef struct __CFError * CFErrorRef; // line 43 in CFError.h
если вы прокрутите вверх, вы увидите это в строке 14 до строки 22:
CFError *error;
if (!ReadFromFile(fd, &error)) {
... process error ...
CFRelease(error); // If an error occurs, the returned CFError must be released.
}
It is the responsibility of anyone returning CFErrors this way to:
- Not touch the error argument if no error occurs
- Create and assign the error for return only if the error argument is non-NULL
Таким образом, нам кажется, что нам нужно самим выпустить CFErrorRef!