opengles2: Fix static analysis warning.

Not clear if this could ever dereference NULL in real life, but better safe
than sorry!
Ryan C. Gordon 2019-03-21 10:39:49 -04:00
parent 01c924fa9e
commit 8ab698af15
1 changed files with 4 additions and 2 deletions

View File

@ -529,8 +529,10 @@ GLES2_CacheProgram(GLES2_RenderData *data, GLES2_ShaderCacheEntry *vertex,
} }
data->glDeleteProgram(data->program_cache.tail->id); data->glDeleteProgram(data->program_cache.tail->id);
data->program_cache.tail = data->program_cache.tail->prev; data->program_cache.tail = data->program_cache.tail->prev;
if (data->program_cache.tail != NULL) {
SDL_free(data->program_cache.tail->next); SDL_free(data->program_cache.tail->next);
data->program_cache.tail->next = NULL; data->program_cache.tail->next = NULL;
}
--data->program_cache.count; --data->program_cache.count;
} }
return entry; return entry;