Fixed analyzer warning "Call to 'calloc' has an allocation size of 0 bytes"

This commit is contained in:
Sam Lantinga 2017-08-28 00:54:02 -07:00
parent 3c7f9d692a
commit edaa0ef53f
1 changed files with 4 additions and 7 deletions

View File

@ -133,14 +133,11 @@ VkExtensionProperties *SDL_Vulkan_CreateInstanceExtensionsList(
if(count == 0) if(count == 0)
{ {
retval = SDL_calloc(1, sizeof(VkExtensionProperties)); // so we can return non-null retval = SDL_calloc(1, sizeof(VkExtensionProperties)); // so we can return non-null
if(!retval) }
else
{ {
SDL_OutOfMemory();
return NULL;
}
*extensionCount = 0;
}
retval = SDL_calloc(count, sizeof(VkExtensionProperties)); retval = SDL_calloc(count, sizeof(VkExtensionProperties));
}
if(!retval) if(!retval)
{ {
SDL_OutOfMemory(); SDL_OutOfMemory();