Commit ed6daea8 authored by Jakob Bornecrantz's avatar Jakob Bornecrantz
Browse files

vulkan-device-select: Don't leak drmDevicePtr

Cc: mesa-stable
parent 4c703686
Pipeline #459539 waiting for manual action with stages
......@@ -91,7 +91,7 @@ int device_select_find_xcb_pci_default(struct device_pci_info *devices, uint32_t
if (dri3_fd == -1)
goto out;
drmDevicePtr xdev;
drmDevicePtr xdev = NULL;
int ret = drmGetDevice2(dri3_fd, 0, &xdev);
close(dri3_fd);
if (ret < 0)
......@@ -113,7 +113,9 @@ int device_select_find_xcb_pci_default(struct device_pci_info *devices, uint32_t
if (default_idx != -1)
break;
}
out:
drmFreeDevice(&xdev); // Is NULL pointer safe.
xcb_disconnect(conn);
return default_idx;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment