mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-25 16:30:05 +01:00
XQuartz: Silence a clang static analysis warning about a memory leak
It seems the alanyzer can't comprehend dixSetPrivate().
quartz.c:119:12: warning: Potential leak of memory pointed to by 'displayInfo'
return quartzProcs->AddScreen(index, pScreen);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit 64327226dd)
This commit is contained in:
parent
b915cbb6bf
commit
a3d19856c6
1 changed files with 3 additions and 0 deletions
|
|
@ -109,11 +109,14 @@ Bool
|
|||
QuartzAddScreen(int index,
|
||||
ScreenPtr pScreen)
|
||||
{
|
||||
// The clang static analyzer thinks we leak displayInfo here
|
||||
#ifndef __clang_analyzer__
|
||||
// allocate space for private per screen Quartz specific storage
|
||||
QuartzScreenPtr displayInfo = calloc(sizeof(QuartzScreenRec), 1);
|
||||
|
||||
// QUARTZ_PRIV(pScreen) = displayInfo;
|
||||
dixSetPrivate(&pScreen->devPrivates, quartzScreenKey, displayInfo);
|
||||
#endif /* __clang_analyzer__ */
|
||||
|
||||
// do Quartz mode specific initialization
|
||||
return quartzProcs->AddScreen(index, pScreen);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue