If realloc fails it returns NULL and out pointer becomes invalid. To fix this it is necessary to store realloc return value in temporary pointer and then compare it with NULL. If it equals NULL then return error and source pointer will still valid. This error was caught by cppcheck: Common realloc mistake: 'out' nulled but not freed upon failure.master
parent
72990efc3e
commit
4e0c494515
1 changed files with 9 additions and 1 deletions
Loading…
Reference in New Issue