xserver/Xext
Alan Coopersmith a7b35e63c6 Xext/xselinux: avoid memory leak in SELinuxAtomToSID()
Reported in #1817:

xwayland-24.1.6/redhat-linux-build/../Xext/xselinux_label.c:142:13: warning[-Wanalyzer-malloc-leak]: leak of ‘rec’
xwayland-24.1.6/redhat-linux-build/../Xext/xselinux_label.c:133:1: enter_function: entry to ‘SELinuxAtomToSID’
xwayland-24.1.6/redhat-linux-build/../Xext/xselinux_label.c:141:15: acquire_memory: allocated here
xwayland-24.1.6/redhat-linux-build/../Xext/xselinux_label.c:69:12: branch_true: following ‘true’ branch...
xwayland-24.1.6/redhat-linux-build/../Xext/xselinux_label.c:142:13: danger: ‘rec’ leaks here; was allocated at [(2)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/1)
#  140|       if (!rec) {
#  141|           rec = calloc(1, sizeof(SELinuxAtomRec));
#  142|->         if (!rec || !SELinuxArraySet(&arr_atoms, atom, rec))
#  143|               return BadAlloc;
#  144|       }

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2072>
(cherry picked from commit 21cbc56c43)
2026-01-25 10:40:02 -08:00
..
bigreq.c Xext: bigreq: drop swapping request length fields 2026-01-25 10:39:59 -08:00
dpms.c Xext: dpms: need to include geext.h 2026-01-25 10:40:00 -08:00
dpmsproc.h dpms: Consolidate a bunch of stuff into Xext/dpms.c 2017-03-27 15:59:47 -04:00
geext.c Xext: geext: move struct _GEExtension into geext.c 2026-01-25 10:40:00 -08:00
geext.h Xext: geext.h: fix missing include of Xfuncproto.h 2026-01-25 10:40:00 -08:00
geint.h xge: Hide some implementation details 2015-07-08 16:40:58 -04:00
hashtable.c dix: Fix undefined shift in ht_generic_hash 2019-10-15 14:06:30 -04:00
hashtable.h Fix spelling/wording issues 2020-07-05 13:07:33 -07:00
meson.build Xace: dont install xace.h and xacestr.h anymore 2026-01-25 10:39:54 -08:00
panoramiX.c panoramix: avoid null dereference in PanoramiXConsolidate() 2026-01-25 10:40:02 -08:00
panoramiX.h Xext: drop _PANORAMIX_SERVER 2026-01-25 10:39:54 -08:00
panoramiXh.h Introduce a consistent coding style 2012-03-21 13:54:42 -07:00
panoramiXprocs.c dix: unexport Ones() 2026-01-25 10:39:57 -08:00
panoramiXsrv.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
panoramiXSwap.c Xext: panoramiX: drop now obsolete swap procs 2026-01-25 10:39:59 -08:00
saver.c Xext: saver: consolidate (non-)xinerama versions 2026-01-25 10:39:59 -08:00
security.c Xext: security: drop swapping request length fields 2026-01-25 10:39:59 -08:00
securitysrv.h Xext: securitysrv.h: drop hacks for including secur.h 2026-01-25 10:39:54 -08:00
shape.c Xext: shape: drop now obsolete swap procs 2026-01-25 10:39:59 -08:00
shm.c Xext/shm: avoid null dereference in ShmInitScreenPriv() 2026-01-25 10:40:02 -08:00
shmint.h xext: Fix shmint.h to not use headers outside of sdk_HEADERS 2013-11-14 10:22:15 +09:00
sleepuntil.c prevent name clash on Windows w/ RT_* defines 2026-01-19 12:48:30 -08:00
sleepuntil.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
sync.c Xext/sync: Avoid dereference of invalid pointer if malloc() failed 2026-01-25 10:40:02 -08:00
syncsdk.h xsync: Add resource inside of SyncCreate, export SyncCreate 2019-04-17 14:01:17 -07:00
syncsrv.h sync: Convert from "CARD64" to int64_t. 2017-09-20 13:19:27 -04:00
vidmode.c Xext/vidmode: avoid null dereference if VidModeCreateMode() allocation fails 2026-01-25 10:40:02 -08:00
xace.c xace: typesafe hook function for XACE_KEY_AVAIL 2026-01-25 10:39:54 -08:00
xace.h Xace: provide definitions of new hook functions when xace is disabled 2026-01-25 10:40:02 -08:00
xacestr.h Replace 'pointer' type with 'void *' 2014-01-12 10:24:11 -08:00
xcmisc.c Xext: xcmisc: drop now obsolete swap procs 2026-01-25 10:39:59 -08:00
xf86bigfont.c xf86bigfont: fix -Werror=unused-variable build failure 2026-01-25 10:40:02 -08:00
xf86bigfontsrv.h Move extension initialisation prototypes into extinit.h 2012-07-09 23:06:41 -07:00
xres.c Xext/xres: avoid null dereference in ProcXResQueryClients() 2026-01-25 10:40:02 -08:00
xselinux.h include: unpexport SELINUX_* consts from include/global.h 2026-01-19 12:32:24 -08:00
xselinux_ext.c Xext/xselinux: add fast path to ProcSELinuxListSelections() 2026-01-25 10:40:02 -08:00
xselinux_hooks.c fix missing includes of <X11/Xfuncproto.h> 2026-01-25 10:39:55 -08:00
xselinux_label.c Xext/xselinux: avoid memory leak in SELinuxAtomToSID() 2026-01-25 10:40:02 -08:00
xselinuxint.h selinux: Stop using security_context_t 2021-08-17 16:02:39 -04:00
xtest.c Xext: xtest: drop now obsolete swap procs 2026-01-25 10:39:59 -08:00
xvdisp.c Xext: xv: drop now obsolete swap procs 2026-01-25 10:39:59 -08:00
xvdisp.h Fix swapped Xv dispatch under Xinerama. 2007-12-02 14:15:36 -05:00
xvdix.h xv: move XvVideoNotifyRec into xvmain.c 2026-01-25 10:39:55 -08:00
xvmain.c xv: move XvVideoNotifyRec into xvmain.c 2026-01-25 10:39:55 -08:00
xvmc.c Xext: xvmc: drop unused XvMCScreenInitProc 2026-01-25 10:39:57 -08:00
xvmcext.h Xext: xvmc: drop unused XvMCScreenInitProc 2026-01-25 10:39:57 -08:00