diff options
author | Jeremy Huddleston Sequoia <jeremyhu@apple.com> | 2014-01-01 11:00:40 -0800 |
---|---|---|
committer | Jeremy Huddleston Sequoia <jeremyhu@apple.com> | 2014-01-22 15:17:36 -0800 |
commit | a3d19856c6b4d323340a98a8c7bf1cfc4b92c83d (patch) | |
tree | d308411321030d92d73b630a48d9f9a305da7002 | |
parent | b915cbb6bf489e8ceb20d1053d1c94ebc981e0dd (diff) | |
download | xserver-a3d19856c6b4d323340a98a8c7bf1cfc4b92c83d.tar.gz |
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 64327226ddfba8f0653615cd678d2d4336fb993d)
-rw-r--r-- | hw/xquartz/quartz.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/xquartz/quartz.c b/hw/xquartz/quartz.c index 5b977c7f9..bc6c8d048 100644 --- a/hw/xquartz/quartz.c +++ b/hw/xquartz/quartz.c @@ -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); |