Fix defects reported by Coverity Scan.
Resource leak (RESOURCE_LEAK)
leaked_storage: Variable signal_semaphore_infos going out of scope leaks the storage it points to
leaked_storage: Variable wait_semaphore_infos going out of scope leaks the storage it points to.
Fixes:
3da7d10d9bb ("radv: implement vkQueueSubmit2KHR()")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14260>
VkSemaphoreSubmitInfoKHR *signal_semaphore_infos =
malloc(sizeof(*signal_semaphore_infos) * pBindInfo[i].signalSemaphoreCount);
- if (!wait_semaphore_infos || !signal_semaphore_infos)
+ if (!wait_semaphore_infos || !signal_semaphore_infos) {
+ free(wait_semaphore_infos);
+ free(signal_semaphore_infos);
return VK_ERROR_OUT_OF_HOST_MEMORY;
+ }
for (uint32_t j = 0; j < pBindInfo[i].waitSemaphoreCount; j++) {
wait_semaphore_infos[j] = (VkSemaphoreSubmitInfoKHR) {