Skip to content

Commit

Permalink
Fixed analyzer warning "Call to 'calloc' has an allocation size of 0 …
Browse files Browse the repository at this point in the history
…bytes"
  • Loading branch information
slouken committed Aug 28, 2017
1 parent 3c7f9d6 commit edaa0ef
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/video/SDL_vulkan_utils.c
Expand Up @@ -133,14 +133,11 @@ VkExtensionProperties *SDL_Vulkan_CreateInstanceExtensionsList(
if(count == 0)
{
retval = SDL_calloc(1, sizeof(VkExtensionProperties)); // so we can return non-null
if(!retval)
{
SDL_OutOfMemory();
return NULL;
}
*extensionCount = 0;
}
retval = SDL_calloc(count, sizeof(VkExtensionProperties));
else
{
retval = SDL_calloc(count, sizeof(VkExtensionProperties));
}
if(!retval)
{
SDL_OutOfMemory();
Expand Down

0 comments on commit edaa0ef

Please sign in to comment.