mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 16:20:03 +01:00
dix: avoid memory leak in ProcListProperties()
Reported in #1817: xwayland-24.1.6/redhat-linux-build/../dix/property.c:584:5: warning[-Wanalyzer-malloc-leak]: leak of ‘pAtoms’ Can happen if, and only if, XaceHookPropertyAccess() blocks access to all properties, so that numProps ends up zero on the second loop. Fixes:39f337fd4("dix: ProcListProperties: skip unneeded work if numProps is 0") Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> (cherry picked from commited92eae84d) Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2076>
This commit is contained in:
parent
cdf3045f3f
commit
88480435c2
1 changed files with 1 additions and 1 deletions
|
|
@ -616,8 +616,8 @@ ProcListProperties(ClientPtr client)
|
|||
if (numProps) {
|
||||
client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write;
|
||||
WriteSwappedDataToClient(client, numProps * sizeof(Atom), pAtoms);
|
||||
free(pAtoms);
|
||||
}
|
||||
free(pAtoms);
|
||||
return Success;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue