Browse Source

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

Sam Lantinga 8 years ago
parent
commit
edaa0ef53f
1 changed files with 4 additions and 7 deletions
  1. 4 7
      src/video/SDL_vulkan_utils.c

+ 4 - 7
src/video/SDL_vulkan_utils.c

@@ -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();