From edaa0ef53f681060cc347e0f3fd4f6b1a148fc4a Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 28 Aug 2017 00:54:02 -0700 Subject: [PATCH] Fixed analyzer warning "Call to 'calloc' has an allocation size of 0 bytes" --- src/video/SDL_vulkan_utils.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/video/SDL_vulkan_utils.c b/src/video/SDL_vulkan_utils.c index d71f1b761847b..d47098404e46f 100644 --- a/src/video/SDL_vulkan_utils.c +++ b/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();