stb_image: fixed 'out' nulled but not freed upon failure
Before adoption: this commit came in with the history the project adopted, so no landing records it.
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.
authored by Georgy Macharadze · committed by Georgy Macharadze · parent 72990ef · Browse files · 1 file+9 added−1 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+9 added−1 removed
- other:+9 added−1 removed