mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 15:10:02 +01: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: cef12efc1 ("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:
parent
6a4ec30af4
commit
3e9baa20f3
1 changed files with 1 additions and 0 deletions
|
|
@ -730,6 +730,7 @@ glamor_get_modifiers(ScreenPtr screen, uint32_t format,
|
||||||
if (!eglQueryDmaBufModifiersEXT(glamor_egl->display, format, num,
|
if (!eglQueryDmaBufModifiersEXT(glamor_egl->display, format, num,
|
||||||
(EGLuint64KHR *) *modifiers, NULL, &num)) {
|
(EGLuint64KHR *) *modifiers, NULL, &num)) {
|
||||||
free(*modifiers);
|
free(*modifiers);
|
||||||
|
*modifiers = NULL;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue