Then I checked the code of cppcheck situationally, and he introduced me to thoughtfulness ..
An example of that code, sawed too much:
void * t(void * p, size_t osz) { if (!(p = realloc(p, ((osz + 1) * sizeof(int))))) { return NULL; } return *p; } what he actually advises:
(error) Common realloc mistake: 'p' nulled but not freed upon failure
so the question is how to remove if returned NULL ?! or copy the address of the variable to another in advance, and in case of failure, delete the link to the original? .. but for some reason it seems to me that there will also be NULL ..
to check in practice there seems to be no possibility, realloc does not seem to break ..
your opinion?