mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 10:14:52 +00:00
glamor: avoid double free in glamor_make_pixmap_exportable()
Reported by gcc 15.1:
../glamor/glamor_egl.c:320:9:
warning: double-‘free’ of ‘modifiers’ [CWE-415] [-Wanalyzer-double-free]
[...]
│ 732 |│ free(*modifiers);
│ |│ ~~~~~~~~~~~~~~~~
│ |│ |
│ |└───────>(25) ...to here
│ | (26) first ‘free’ here
[...]
│ 320 | free(modifiers);
│ | ~~~~~~~~~~~~~~~
│ | |
│ | (28) ⚠️
second ‘free’ here; first ‘free’ was at (26)
Fixes: cef12efc15 ("glamor: Implement GetSupportedModifiers")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2094>
This commit is contained in:
committed by
Enrico Weigelt
parent
4db6ede54d
commit
4b65fdd356
@@ -850,6 +850,7 @@ glamor_get_modifiers(ScreenPtr screen, uint32_t format,
|
||||
if (!eglQueryDmaBufModifiersEXT(glamor_egl->display, format, num,
|
||||
(EGLuint64KHR *) *modifiers, NULL, &num)) {
|
||||
free(*modifiers);
|
||||
*modifiers = NULL;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user