mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 04:30:10 +01:00
egl: fix memory leak related to _eglRefreshDeviceList()
Indeed, the unnecessary drmDevice objects were not freed.
For instance, this issue could be triggered with: "piglit/bin/egl_ext_platform_device -auto -fbo":
SUMMARY: AddressSanitizer: 2796 byte(s) leaked in 12 allocation(s).
Fixes: e39d72aec2 ("egl: only take render nodes into account when listing DRM devices")
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22408>
This commit is contained in:
parent
1fa1c285fc
commit
f9401a515a
1 changed files with 3 additions and 1 deletions
|
|
@ -284,8 +284,10 @@ _eglRefreshDeviceList(void)
|
|||
|
||||
num_devs = drmGetDevices2(0, devices, ARRAY_SIZE(devices));
|
||||
for (int i = 0; i < num_devs; i++) {
|
||||
if (!(devices[i]->available_nodes & (1 << DRM_NODE_RENDER)))
|
||||
if (!(devices[i]->available_nodes & (1 << DRM_NODE_RENDER))) {
|
||||
drmFreeDevice(&devices[i]);
|
||||
continue;
|
||||
}
|
||||
|
||||
ret = _eglAddDRMDevice(devices[i], NULL);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue