Don't do NULL-checks before SDL_free()
Replaces the pattern
if (ptr) {
SDL_free(ptr);
}
with
SDL_free(ptr);
This commit is contained in:
committed by
Sam Lantinga
parent
2f810e0a5f
commit
aaee09d6ed
@@ -1177,9 +1177,7 @@ static bool SDLCALL dynamic_mem_close(void *userdata)
|
||||
{
|
||||
const IOStreamDynamicMemData *iodata = (IOStreamDynamicMemData *) userdata;
|
||||
void *mem = SDL_GetPointerProperty(SDL_GetIOProperties(iodata->stream), SDL_PROP_IOSTREAM_DYNAMIC_MEMORY_POINTER, NULL);
|
||||
if (mem) {
|
||||
SDL_free(mem);
|
||||
}
|
||||
SDL_free(mem);
|
||||
SDL_free(userdata);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user