mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 06:48:06 +02: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> (cherry picked from commitf9401a515a)
This commit is contained in:
parent
41bab238dc
commit
0c85cb051f
2 changed files with 4 additions and 2 deletions
|
|
@ -4574,7 +4574,7 @@
|
|||
"description": "egl: fix memory leak related to _eglRefreshDeviceList()",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": "e39d72aec203ee317feb87ba1c8953a99aad2a5c",
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -300,8 +300,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