Skip to content

Commit

Permalink
opengles2: Fix static analysis warning.
Browse files Browse the repository at this point in the history
Not clear if this could ever dereference NULL in real life, but better safe
than sorry!
  • Loading branch information
icculus committed Mar 21, 2019
1 parent 01c924f commit 8ab698a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/render/opengles2/SDL_render_gles2.c
Expand Up @@ -529,8 +529,10 @@ GLES2_CacheProgram(GLES2_RenderData *data, GLES2_ShaderCacheEntry *vertex,
}
data->glDeleteProgram(data->program_cache.tail->id);
data->program_cache.tail = data->program_cache.tail->prev;
SDL_free(data->program_cache.tail->next);
data->program_cache.tail->next = NULL;
if (data->program_cache.tail != NULL) {
SDL_free(data->program_cache.tail->next);
data->program_cache.tail->next = NULL;
}
--data->program_cache.count;
}
return entry;
Expand Down

0 comments on commit 8ab698a

Please sign in to comment.