mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-27 16:39:06 +00:00
Reported in #1817: Error: GCC_ANALYZER_WARNING (CWE-476): [#def5] xwayland-24.1.6/redhat-linux-build/../Xext/panoramiX.c:820:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘root’ xwayland-24.1.6/redhat-linux-build/../Xext/panoramiX.c:819:12: acquire_memory: this call could return NULL xwayland-24.1.6/redhat-linux-build/../Xext/panoramiX.c:820:5: danger: ‘root’ could be NULL: unchecked value from (1) 818| 819| root = malloc(sizeof(PanoramiXRes)); 820|-> root->type = XRT_WINDOW; 821| defmap = malloc(sizeof(PanoramiXRes)); 822| defmap->type = XRT_COLORMAP; Error: GCC_ANALYZER_WARNING (CWE-476): [#def6] xwayland-24.1.6/redhat-linux-build/../Xext/panoramiX.c:822:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘defmap’ xwayland-24.1.6/redhat-linux-build/../Xext/panoramiX.c:821:14: acquire_memory: this call could return NULL xwayland-24.1.6/redhat-linux-build/../Xext/panoramiX.c:822:5: danger: ‘defmap’ could be NULL: unchecked value from (1) 820| root->type = XRT_WINDOW; 821| defmap = malloc(sizeof(PanoramiXRes)); 822|-> defmap->type = XRT_COLORMAP; 823| saver = malloc(sizeof(PanoramiXRes)); 824| saver->type = XRT_WINDOW; Error: GCC_ANALYZER_WARNING (CWE-476): [#def7] xwayland-24.1.6/redhat-linux-build/../Xext/panoramiX.c:824:5: warning[-Wanalyzer-possible-null-dereference]: dereference of possibly-NULL ‘saver’ xwayland-24.1.6/redhat-linux-build/../Xext/panoramiX.c:823:13: acquire_memory: this call could return NULL xwayland-24.1.6/redhat-linux-build/../Xext/panoramiX.c:824:5: danger: ‘saver’ could be NULL: unchecked value from (1) 822| defmap->type = XRT_COLORMAP; 823| saver = malloc(sizeof(PanoramiXRes)); 824|-> saver->type = XRT_WINDOW; 825| 826| FOR_NSCREENS(i) { Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2065>