Fixed analyzer warning "Call to 'calloc' has an allocation size of 0 bytes"
authorSam Lantinga <slouken@libsdl.org>
Mon, 28 Aug 2017 00:54:02 -0700
changeset 113851b4ef2593eca
parent 11384 269bdd5aa742
child 11386 d5c2d689bf6d
Fixed analyzer warning "Call to 'calloc' has an allocation size of 0 bytes"
src/video/SDL_vulkan_utils.c
     1.1 --- a/src/video/SDL_vulkan_utils.c	Mon Aug 28 00:51:14 2017 -0700
     1.2 +++ b/src/video/SDL_vulkan_utils.c	Mon Aug 28 00:54:02 2017 -0700
     1.3 @@ -133,14 +133,11 @@
     1.4      if(count == 0)
     1.5      {
     1.6          retval = SDL_calloc(1, sizeof(VkExtensionProperties)); // so we can return non-null
     1.7 -        if(!retval)
     1.8 -        {
     1.9 -            SDL_OutOfMemory();
    1.10 -            return NULL;
    1.11 -        }
    1.12 -        *extensionCount = 0;
    1.13      }
    1.14 -    retval = SDL_calloc(count, sizeof(VkExtensionProperties));
    1.15 +	else
    1.16 +	{
    1.17 +		retval = SDL_calloc(count, sizeof(VkExtensionProperties));
    1.18 +	}
    1.19      if(!retval)
    1.20      {
    1.21          SDL_OutOfMemory();